errno bug and gcc internal error

Jeroen Ruigrok/asmodai asmodai at
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;}


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


>`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)> / asmodai / kita no mono
Free Tibet! |   |
There is no greater sorrow than to recall, in misery, the time when we
were happy...

More information about the Bugs mailing list