On Mon, Feb 05, 2001 at 12:06:15PM -0500, Greg Hudson wrote:
> > /usr/include/sys/socket.h:47: syntax error before `sa_family_t'
> > [etc.]
> The problem is the -D_POSIX_SOURCE which Greg Stein added last night.
> I was thinking of sending mail about it at the time, but decided he
> had probably done all the necessary footwork; I guess he missed
I only had a Linux box to test on. Everything in SVN compiled totally
cleanly on my system. I spent a good amount of time trying to figure out the
right combination to allow us to include <string.h> and <strings.h> (which
is done by apr_want.h) without some redundant declaration warnings.
One solution to that was removing the -Wredundant-decls, but I figured that
we could solve it properly with the _POSIX_SOURCE thing.
> If you define _POSIX_SOURCE, you cannot portably include system
> headers which are not specified by POSIX (including them indirectly
> through apr header files doesn't change anything). A well-behaved
> system will work anyway, but many systems will fail confusingly like
> you reported; <sys/types.h> doesn't define something like u_char which
> is used in the non-POSIX header file.
Feh. Damn FreeBSD :-)
Ben: can you try removing the include of sys/socket.h from apr.h? I won't be
able to get to this for several hours. I'll try it then and clean up any
problems in APR. Basically: there is no reason for that header to be
included in apr.h, so the right answer here is to nuke it.
I'll also get a build environment set up on apache.org, which is a FreeBSD
box, and then take a look into the SourceForge compile farm to see what they
may have (there is also a Compaq compile farm which has *BSD).
> Remove the -D_POSIX_SOURCE and things should build again, or at least
> shouldn't run into this problem.
One answer, yah. But we should be able to compile with it. If we have things
that aren't POSIX standard, then we have a potential portability problem. If
APR is publicly relying on non-POSIX stuff, then we must fix APR.
[ I already made a number of changes to APR last night to deal with some
BSDisms in its code ]
Removing redundant-decl was the easy fix, but I didn't think it was the
right fix. Removing POSIX_SOURCE is also the easy fix, but I don't think the
right fix :-)
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:21 2006