This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: gtk-peer compile fixes for gcc-2.95


Mark Wielaard wrote:
> > On Fri, 2004-04-09 at 16:53, Archie Cobbs wrote:
> > > Surely Classpath uses some non-POSIX functions (otherwise why would
> > > _BSD_SOURCE be required on Linux?), so hopes are dim on this working.
> >
> > Thanks for the info, I came up with the above settings by trial and
> > error. I hope they are as strict as needeed. There should indeed not be
> > any non-POSIX-isms in the current source except when the build can
> > detect that it is save to use in the build environment (that is why we
> > use the autotools).
> 
> Just to make this more clear. Under ISO C 90 some newer C library
> functions aren't available, so glibc correctly hides them. That is why
> we need the _BSD_SOURCE defined on GNU systems when compiling with
> -std=c89. It will define those newer ISO C/Posix functions that came
> from old BSD and GNU systems and are always available there. If there is
> another flag for use with BSD systems that enable these function
> declarations under strict ISO C 90 rules we must add that to the
> AM_CFLAGS.

I'm not an expert on this stuff so my apologies if I'm confused...

First of all, it seems like -std=c89 specifies the variant of the
C language that the compiler expects, whereas _BSD_SOURCE and
_POSIX_SOURCE affect what declarations (and #define's) are included
in the namespace visible to the compiler from #include files.

So these two things seem to be orthogonal, so I don't understand what
you mean by "we need the _BSD_SOURCE defined on GNU systems when compiling
with -std=c89".

On the other hand, it would make sense if you said: "we need the _BSD_SOURCE
defined on GNU systems when compiling with _POSIX_SOURCE".

Now, back to my other question: why not just get rid of _POSIX_SOURCE?
That seems to solve the problem in all cases (unless I'm confused, which
is probably the case :-)

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com


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