Ticket #156 (new defect)

Opened 4 years ago

Last modified 3 years ago

_XOPEN_SOURCE causes compiler warnings on OS X

Reported by: dmacks Owned by: lennart
Milestone: Component: build-system
Keywords: Cc:

Description

configure.ac has:

# Solaris stuff [...] AC_CHECK_DECL([CMSG_SPACE]CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -DEXTENSIONS")

The AC_CHECK_DECL result on my OS X 10.3 (gcc3.3) and apparently also on 10.4 (gcc4.0) machines cause compiler warnings from system headers. Removing the _XOPEN_SOURCE token from that configure action solves it. I'm not a Solaris machine, so the explanation of the check is out of sync with the check itself, and the test gives an inappropriate result on my platform.

What's the actual intent here? Should the whole thing be conditionalized on a platform/host test?

Change History

Changed 4 years ago by dmacks

(sorry, wiki-formatting ate the codeblock)

# Solaris stuff
[...]
AC_CHECK_DECL([CMSG_SPACE]CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -DEXTENSIONS")

Changed 4 years ago by lennart

Hmm, the check is indeed strange. I am not sure how to fix this best. TBH i don't care too much as long as my Linux build doesn't break. I have neither Solaris nor MacOSX around, hence I am unable to cook up a patch.

The right fix is probably something that checks whether CMSG_SPACE becomes available as soon as those two definitions are made.

Changed 4 years ago by dmacks

I'll be happy to work on a patch when I get a moment. Would be great if a Solaris person would let me know what the actual goal here and meaning of those -D flags is: sounds like we should see whether CMSG_SPACE is available without flags, and if not, try again with flags, and if they become available with flags, include the flags?

Changed 3 years ago by Zanchey

I ran into similar issues with cmsg stuff on Solaris in glib (see http://bugzilla.gnome.org/show_bug.cgi?id=582856), and submitted the Avahi checks as a patch. They instead suggested this: http://bugzilla.gnome.org/attachment.cgi?id=135301&action=view

The current Avahi solution breaks IPv6 includes on FreeBSD, and therefore breaks the build of Avahi.

Note: See TracTickets for help on using tickets.