errno bug and gcc internal error

Jeroen Ruigrok/asmodai asmodai at in-nomine.org
Tue Jul 19 21:31:15 PDT 2005


-On [20050719 17:53], YONETANI Tomokazu (qhwt+dfly at xxxxxxxxxx) wrote:
>$ cat a.c
>extern int errno;
>int main(void) {return errno;}

[snip]

>I know this is a software error and I know how to handle this easily:

[snip]

>`bzzzt, your software declares errno as an extern int, which is incorrect.'

You can do

external int errno;

Just don't include errno.h.  But the behaviour of this is undefined.

-- 
Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono
Free Tibet! http://www.savetibet.org/ | http://ashemedai.deviantart.com/
http://www.tendra.org/   | http://www.in-nomine.org/
There is no greater sorrow than to recall, in misery, the time when we
were happy...





More information about the Bugs mailing list