This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin 1.5.24-2 gcc 3.4.4 stdio.h


Corinna Vinschen wrote:
Hi Jeff,

On Nov 30 13:39, Jeff Johnston wrote:
Paul Edwards wrote:
Dave Korn wrote...
"-ansi" is meant to mask all the Posix stuff and just provide pure ANSI C89
headers.
Agreed. I don't know if it's a goal of newlib to support strict C89
conformance or not,
It's not a C compiler if it fails to even conform to the C89 standard.
but I don't see how it could hurt to add a few #ifndef
__STRICT_ANSI__ here and there.
They're already there in fact, just not accurate. It's a bug, basically.
It probably used to work and someone broke it.
A Cygwin change added a number of the _POSIX flags inside sys/features.h. This could easily be modified to have a check for strict C89 ANSI in it.

I have attached a proposed patch. Any comments from the Cygwin folks?

If it's generally correct to guard the _POSIX_xxx flags with a !__STRICT_ANSI__, shouldn't this guard surround all definitions instead of only the ones for Cygwin?

However, I don't think that it is actually correct because the
_POSIX_xxx flags should always be defined to be able to check for OS
features.  I'm rather curious why the `#ifndef __STRICT_ANSI__', which
guards all of sys/signal.h except the signal names, has been commented
out once.


It is not "wrong" to not define the flags for C89. They don't exist in the C89 spec. Code that "needs" to be compiled C89 ANSI won't be checking _POSIX flags and certainly won't be doing so without checking for them being defined first. If you feel there is a legitimate usage case, you can always add a #else for Cygwin.


Yes, the check would be better outside both Cygwin and RTEMS.

Regarding the __STRICT_ANSI__ check in sys/signal.h, it appears to have been removed when the RTEMS headers were merged in and I can restore it with the more complex check so C++ and C99 are not affected.

-- Jeff J.


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