-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruno Haible on 3/25/2007 2:22 PM: > Warning seen on IRIX 6.5: > > "///usr/include/unistd.h", line 43: warning(1047): macro redefined differently > > IRIX 6.5 has two definitions of EX_OK: > - one in <unistd.h>, protected with "#if _SGIAPI", as a flag that can be > passed to the access() function, with value 020, > - one in <sysexits.h>, always active, as an exit code, with value 0. > > Which definition is active, thus depends on the order of inclusion.
Hmm. EX_OK is not standardized, nor does it fall within the namespace reserved for use by unistd.h. But sysexits.h is not even a standardized header, so it is less likely to be used in a portable program. Also, EXIT_SUCCESS of stdlib.h has been standardized. And looking at the name, I recognized the _OK suffix more than the EX_ prefix. > > What should we do? > I would go with option d) Create a replacement <unistd.h> that does #if HAVE_SYSEXITS_H # include <sysexits.h> #endif #undef EX_OK #include </usr/include/unistd.h> with no change to sysexits.h thereby preventing portable programs from falling into the trap of using non-portable EX_OK as an exit status, while still allowing IRIX-specific code to query the extended access() attribute. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGBvgd84KuGfSFAYARAqlGAJ0UAzmjQnlNgY2kkNONHmvKkXIL3ACfaSb9 gbDfIJk4232yYTUOZra53MI= =LGbS -----END PGP SIGNATURE-----