This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: warn against K&R compiler in glibc 2.2


>>>>> Ulrich Drepper writes:

Ulrich> Andreas Jaeger <aj@suse.de> writes:
>> The easiest way is AFAIK to add the following to some file:
>> #ifndef __STDC__
>> # error "You need a ISO C conforming compiler to use the glibc headers"
>> #endif

Ulrich> If we are thinking about other compilers but gcc (which is legitimate
Ulrich> for the use of glibc) then this is not enough.  Most compilers beside
Ulrich> gcc do not define __STDC__ except if you direct the compiler to be
Ulrich> strictly compliant.  This is a weakness in the ISO C standard.
:-(

Ulrich> I don't know whether we can add any reasonable check.

We can at least check for gcc -traditional with:
#if defined __GNUC__ && __STDC__
# error "You need a ISO C conforming compiler to use the glibc headers"
#endif

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]