Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!randvax!segue!jim From: jim@segue.segue.com (Jim Balter) Newsgroups: comp.unix.sysv386 Subject: Re: Help with gcc under ISC 2.2 Message-ID: <5234@segue.segue.com> Date: 18 Dec 90 19:15:38 GMT References: <1990Dec17.190525.16868@agate.berkeley.edu> Reply-To: jim@segue.segue.com (Jim Balter) Distribution: usa Organization: Segue Software, Inc. - Santa Monica, CA. +1-213-453-2161 Lines: 27 In article <1990Dec17.190525.16868@agate.berkeley.edu> ilan343@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".