Help with gcc under ISC 2.2

Jim Balter jim at segue.segue.com
Wed Dec 19 06:15:38 AEST 1990


In article <1990Dec17.190525.16868 at agate.berkeley.edu> ilan343 at violet.berkeley.edu (Geraldo Veiga) writes:
>/usr/include/sys/stat.h:97: parse error before `mode_t'

Find the line	#if defined(_POSIX_SOURCE) || defined(POSIX_JC)
in /usr/include/sys/types.h and change it to

#if 1

This will fix the mode_t problem.  There seems to be wide misunderstanding
of the meaning of _POSIX_SOURCE.  The user can define _POSIX_SOURCE to
guarantee a clean POSIX namespace.  But nothing should ever be *excluded*
if _POSIX_SOURCE *isn't* defined.

There are also problems with __STDC__.  An ANSI C compiler is supposed to
define this; you can make the use of prototypes and ANSI C preprocessor
semantics conditional upon __STDC__.  BUt __STDC__, unlike _POSIX_SOURCE, is
not defined by the user and should not be used to *exclude* non-ANSI features.
Some other symbol should be used to get a clean ANSI namespace.  POSIX 1003.1
recommends __STDH__; GCC uses __STRICT_ANSI__.  While the proper usage of
__STDC__ with regard to non-strictly conforming implementations isn't discussed
in the C Standard, it was discussed in committee, and was mentioned in one of
the responses to public comments.

SysV.4 has a rather bizarre "solution": defining __STDC__ as 0 will allow
non-ANSI features in standard headers.  I don't understand the thinking that
can lead to the default on a UNIX system being that fileno isn't defined.
It doesn't reflect a high "quality of implementation".



More information about the Comp.unix.sysv386 mailing list