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

Re: _PC_VDISABLE cpp problem



According to
http://pubs.opengroup.org/onlinepubs/7908799/xsh/unistd.h.html
_POSIX_VDISABLE is either undefined, or defined to a value other than
-1.  As far as I can tell, no text requires that it be defined to a
valid *preprocessor* number.  In fact,
http://standards.ieee.org/findstds/interps/1003-1-90_int/pasc-1003.1-27.html
states that
    Interpretation Response 
    The standard does not require that _POSIX_VDISABLE be a preprocessor
    number. The standard does not require that _POSIX_VDISABLE be usable in
    numeric comparisons in the preprocessor.

Therefore, I would change the check in ost.c to
    #if defined(_POSIX_VDISABLE)
if defense against the forbidden integer value -1 is truly required
because of some other POSIX-violating target platform, it must be done
as a "runtime" test (though such an if() with a constant condition is
likely to be optimized away by gcc under any nonzero optimization level)

Jeff


Reply to: