bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EX_OK collision


From: Simon Josefsson
Subject: Re: EX_OK collision
Date: Mon, 26 Mar 2007 10:32:16 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

Bruno Haible <address@hidden> writes:

> 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.
>
> What should we do?
>
>   (a) Do nothing.
>
>   (b) Create a replacement <sysexits.h> that does
>
>          #include <unistd.h>
>          #undef EX_OK
>          #include </usr/include/sysexits.h>
>
>   (c) Create a replacement <unistd.h> that does
>
>          #include </usr/include/unistd.h>
>          #undef EX_OK
>
>       and a replacement <sysexits.h> that does
>
>          #include <unistd.h>
>          #include </usr/include/sysexits.h>

I prefer b) and c) over a), since I think this may cause problems if
anyone is using EX_OK.  I have a mild preference to treat this as a
bug in unistd.h, and thus favor c).

Possibly the bug-workaround for unistd.h should only be enabled if the
sysexits module is present, otherwise the unistd-module would always
touch non-standardized namespaces which seems wrong.  Thus:

e) Create a replacement <unistd.h> that does:

   #include </usr/include/unistd.h>
   #if @GNULIB_SYSEXITS@
   #  undef EX_OK
   #endif

What do you think?

Possibly e) should also add the sysexits.h replacement, as per c).

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]