This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: cygwin 1.5.24-2 gcc 3.4.4 stdio.h
- From: "Paul Edwards" <mutazilah at gmail dot com>
- To: <newlib at sources dot redhat dot com>
- Date: Fri, 30 Nov 2007 11:44:05 +1100
- Subject: Re: cygwin 1.5.24-2 gcc 3.4.4 stdio.h
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.
> http://sourceware.org/newlib/download.html
> gives you the instructions for checking newlib out of CVS to a local
> directory.
These sources are quite a bit different from what I am running in Cygwin.
So I modified what I was actually using instead.
However, there are fundamental design questions raised. E.g. I started
copying the clock_t definitions from sys/types.h to time.h so that I could
mask out the include of sys/types.h from time.h. That worked, but it may
not be a very nice solution, having the definitions repeated.
However, this one I had no answer for:
sys/signal.h has:
/* #ifndef __STRICT_ANSI__*/
#if defined(_POSIX_THREADS)
#include <sys/types.h> /* for pthread data types */
#endif
So it obviously used to be set up to handle ANSI, but it was replace with
this _POSIX_THREADS. I could reverse that change, but I don't know
whether that is the right thing to do. Alternatively I could stop the various
files from including feature.h which is what defines that _POSIX_THREADS.
It really needs to have the design thought about in order to restore it to
actually being a C compiler. On my Win 98 machine I have Cygwin
installed, a really old version that uses egcs-2.91.57. But it at least
works. I don't know of anything non-compliant about this compiler.
But this new version of Cygwin basically doesn't come with an
ANSI-compliant C compiler, while the one from many years ago does.
I am reminded why I am loathe to upgrade software.
BFN. Paul.