This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/86377] extern int errno; is treated as buggy function declaration [-Werror=strict-prototypes]


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86377

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
In fact <errno.h> is required to define it as a macro in C, and a footnote
says:
"The macro errno need not be the identifier of an object. It might expand to a
modifiable lvalue resulting from a function call (for example, *errno())."

Also since 'errno' is reserved as an identifier with external linkage, the
declaration in your program has undefined behaviour even if you don't include
<errno.h>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]