This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libmudflap/mf-hooks2.c portability breakage
- From: kaih at khms dot westfalen dot de (Kai Henningsen)
- To: gcc at gcc dot gnu dot org
- Date: 29 Jul 2003 21:37:00 +0200
- Subject: Re: libmudflap/mf-hooks2.c portability breakage
- Comment: Unsolicited commercial mail will incur an US$100 handling fee per received mail.
- Organization: Organisation? Me?! Are you kidding?
- References: <Pine.BSF.4.56.0307291422240.68102@acrux.dbai.tuwien.ac.at>
gerald@pfeifer.com (Gerald Pfeifer) wrote on 29.07.03 in <Pine.BSF.4.56.0307291422240.68102@acrux.dbai.tuwien.ac.at>:
> FreeBSD fails to bootstrap tree-ssa branch, because libmudflap/mf-hooks2.c
> contains
>
> /* These attempt to coax various unix flavours to declare all our
> needed tidbits in the system headers. */
> #define _POSIX_SOURCE <<---
> #define _GNU_SOURCE
> #define _XOPEN_SOURCE
> #define _BSD_TYPES
> #define __EXTENSIONS__
>
> and afterwards includes <sys/types.h>, which on FreeBSD 4.8 has the
> following
>
> #ifndef _POSIX_SOURCE
> typedef unsigned char u_char;
> typedef unsigned short u_short;
> typedef unsigned int u_int;
> typedef unsigned long u_long;
> typedef unsigned short ushort; /* Sys V compatibility */
> typedef unsigned int uint; /* Sys V compatibility */
> #endif
>
> so, in the end, the following part of <sys/socket.h> which is included a
> bit fails to compile (as u_char is undefined):
>
> typedef u_char sa_family_t;
>
> Defining _POSIX_SOURCE breaks compilation on FreeBSD.
That would seem to be a (pretty obvious) bug in FreeBSD. After all, the
whole intention of _POSIX_SOURCE is to make visible bits for POSIX not in
ANSI/ISO C, such as the socket stuff.
Does it also break with the more modern
#define _POSIX_C_SOURCE 2001<whatever>
?
(And would not this be a candidate for fixincludes?)
MfG Kai