* [U-Boot] [PATCH] include/compiler.h: remove redunandt declaration of errno @ 2010-06-20 0:20 y at denx.de 2010-06-20 1:58 ` Mike Frysinger 0 siblings, 1 reply; 3+ messages in thread From: y at denx.de @ 2010-06-20 0:20 UTC (permalink / raw) To: u-boot From: Wolfgang Denk <wd@denx.de> Commit 37566090 "compiler.h: unify system ifdef cruft here" added both a "#include <errno.h>" and a "extern int errno;" to include/compiler.h which is causing build warnings for some systems, for example for the "netstar" board: In file included from /home/wd/git/u-boot/work/lib/crc32.c:15: include/compiler.h:28: warning: function declaration isn't a prototype The declaration of "errno" should be redundant, as <errno.h> is supposed to provide a correct declaration, so drop it. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Mike Frysinger <vapier@gentoo.org> --- include/compiler.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/include/compiler.h b/include/compiler.h index 8030bf6..23f4b83 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -25,8 +25,6 @@ #include <stdio.h> #include <string.h> -extern int errno; - #if !defined(__WIN32__) && !defined(__MINGW32__) # include <sys/mman.h> #endif -- 1.7.0.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] include/compiler.h: remove redunandt declaration of errno 2010-06-20 0:20 [U-Boot] [PATCH] include/compiler.h: remove redunandt declaration of errno y at denx.de @ 2010-06-20 1:58 ` Mike Frysinger 2010-06-20 10:12 ` Wolfgang Denk 0 siblings, 1 reply; 3+ messages in thread From: Mike Frysinger @ 2010-06-20 1:58 UTC (permalink / raw) To: u-boot On Saturday, June 19, 2010 20:20:33 y at denx.de wrote: > Commit 37566090 "compiler.h: unify system ifdef cruft here" added both > a "#include <errno.h>" and a "extern int errno;" to include/compiler.h it isnt new code, it sucked the definitions out of random files that had these and into one place > which is causing build warnings for some systems, for example for the > "netstar" board: > > In file included from /home/wd/git/u-boot/work/lib/crc32.c:15: > include/compiler.h:28: warning: function declaration isn't a prototype never seen that, but i imagine re-ordering the lines might address it as well (extern then include) > The declaration of "errno" should be redundant, as <errno.h> is > supposed to provide a correct declaration, so drop it. there are older systems where this isnt true, but ive never used one myself and if we dont care about them (i dont), then this is fine -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/20100619/f9e6bbfb/attachment.pgp ^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] include/compiler.h: remove redunandt declaration of errno 2010-06-20 1:58 ` Mike Frysinger @ 2010-06-20 10:12 ` Wolfgang Denk 0 siblings, 0 replies; 3+ messages in thread From: Wolfgang Denk @ 2010-06-20 10:12 UTC (permalink / raw) To: u-boot Dear Mike Frysinger, In message <201006192158.42049.vapier@gentoo.org> you wrote: > > On Saturday, June 19, 2010 20:20:33 y at denx.de wrote: > > Commit 37566090 "compiler.h: unify system ifdef cruft here" added both > > a "#include <errno.h>" and a "extern int errno;" to include/compiler.h > > it isnt new code, it sucked the definitions out of random files that had these > and into one place Yes, I know. I didn't want to blame you, I just wanted to point out where it's coming from. > > In file included from /home/wd/git/u-boot/work/lib/crc32.c:15: > > include/compiler.h:28: warning: function declaration isn't a prototype > > never seen that, but i imagine re-ordering the lines might address it as well > (extern then include) > > > The declaration of "errno" should be redundant, as <errno.h> is > > supposed to provide a correct declaration, so drop it. > > there are older systems where this isnt true, but ive never used one myself> > and if we dont care about them (i dont), then this is fine Well, the man page says: errno is defined by the ISO C standard to be a modifiable lvalue of type int, and must not be explicitly declared; errno may be a macro. errno is thread-local; setting it in one thread does not affect its value in any other thread. The "must not be explicitly declared" (because it "may be a macro") is pretty clear, it seems. Thanks for commenting, I'll apply it then. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Above all else -- sky. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-20 10:12 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-06-20 0:20 [U-Boot] [PATCH] include/compiler.h: remove redunandt declaration of errno y at denx.de 2010-06-20 1:58 ` Mike Frysinger 2010-06-20 10:12 ` Wolfgang Denk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox