On Fri, Oct 07, 2005 at 03:42:57PM -1000, Joshua Hoblitt wrote:
> On Fri, Oct 07, 2005 at 09:34:27AM +0200, Leopold Toetsch wrote:
> > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > 
> > > Modified:
> > >    trunk/config/init/hints/linux.pl
> > > Log:
> > > Defined _X_OPEN_SOURCE=600 in ccflags to fix implicit POSIX function
> > >   declaration warnings when compiling src/platform.c.
> > 
> > > +if ( $cflags !~ /-D_XOPEN_SOURCE=/ ) {
> > > +    # Request visibility of all POSIX symbols
> > > +    $cflags .= ' -D_XOPEN_SOURCE=600';
> > > +}
> > 
> > This doesn't work on my box - I get tons of warnings and it eventually
> > dies:
> > 
> 
> Bazzar - I wonder if your glibc is so old that it doesn't support
> unix98.  That would have to be a version of glibc 2.0.x where X is a
> pretty low number...  Does switching '_XOPEN_SOURCE=600' to
> '_XOPEN_SOURCE=500' make any difference?  You could also try
> '-D_GNU_SOURCE' which should enable a superset of _XOPEN_SOURCE.

I was digging through glibc's NEWS and Changelog looking for the answer
to this riddle and found it in the last place I looked, the
posix_memalign() man page - DOH!

From the man page included with glibc 2.3.4:
--
AVAILABILITY
       The functions memalign() and valloc() have been available in all  Linux
       libc libraries.  The function posix_memalign() is available since glibc
       2.1.91.


CONFORMING TO
       The function valloc() appeared in 3.0 BSD. It is  documented  as  being
       obsolete  in  BSD  4.3,  and as legacy in SUSv2. It no longer occurs in
       SUSv3.  The function memalign() appears in SunOS 4.1.3 but not  in  BSD
       4.4.  The function posix_memalign() comes from POSIX 1003.1d.


HEADERS
       Everybody  agrees  that  posix_memalign() is declared in <stdlib.h>. In
       order to declare it, glibc needs _GNU_SOURCE defined, or  _XOPEN_SOURCE
       defined to a value not less than 600.

       Everybody agrees that memalign() is declared in <malloc.h>.

       According  to  SUSv2,  valloc() is declared in <stdlib.h>.  Libc4,5 and
       glibc declare it in <malloc.h> and perhaps also in <stdlib.h>  (namely,
       if _GNU_SOURCE is defined, or _BSD_SOURCE is defined, or, for glibc, if
       _XOPEN_SOURCE_EXTENDED is defined, or, equivalently,  _XOPEN_SOURCE  is
       defined to a value not less than 500).
--

Attachment: pgpRhgB9bzu2G.pgp
Description: PGP signature

Reply via email to