[U-Boot] Why cmd_tbl_t is referenced as extern in defining __u_boot_cmd_start?

Mike Frysinger vapier at gentoo.org
Tue Nov 9 15:20:25 CET 2010


On Tuesday, November 02, 2010 11:56:31 legendbb wrote:
> line 64 and 65 in include/command.h
> 
> extern cmd_tbl_t  __u_boot_cmd_start;
> extern cmd_tbl_t  __u_boot_cmd_end;
> 
> definition of cmd_tbl_t is just one line above these. Why "extern" is used?

basic C question ?  if you dont have the extern, you'd be declaring storage 
for two variables instead of references to the symbols elsewhere.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101109/31e53fee/attachment.pgp 


More information about the U-Boot mailing list