cygwin 1.5.24-2 gcc 3.4.4 stdio.h
Fri Nov 30 18:41:00 GMT 2007
Dave Korn wrote...
>> "-ansi" is meant to mask all the Posix stuff and just provide pure ANSI C89
> 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.
> gives you the instructions for checking newlib out of CVS to a local
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:
/* #ifndef __STRICT_ANSI__*/
#include <sys/types.h> /* for pthread data types */
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.
More information about the Newlib