libmudflap/mf-hooks2.c portability breakage
Andreas Jaeger
aj@suse.de
Tue Jul 29 14:23:00 GMT 2003
Gerald Pfeifer <gerald@pfeifer.com> writes:
> 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. The question is:
> which systems really does need it? Unfortunately, there is not comment
> explaining that. :-(
Just one datapoint:
If you define _GNU_SOURCE on a glibc system, you do not need any of
the other defines.
Andreas
--
Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20030729/bdbac933/attachment.sig>
More information about the Gcc
mailing list