c++/3652: default definition of _GNU_SOURCE breaks programs

enrico.scholz@informatik.tu-chemnitz.de enrico.scholz@informatik.tu-chemnitz.de
Wed Jul 11 14:36:00 GMT 2001


>Number:         3652
>Category:       c++
>Synopsis:       default definition of _GNU_SOURCE breaks programs
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 11 14:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
>Release:        unknown-1.0
>Organization:
>Environment:
Host type: i386-redhat-linux-gnu
System: Linux kosh.ultra.csn.tu-chemnitz.de 2.4.6 #2 Mit Jul 4 08:30:43 CEST 2001 i686 unknown
Architecture: i686
>Description:
The current practice of g++3 to define _GNU_SOURCE has (propably) unwanted sideeffects making standard-conforming programs not working anymore.

E.g. _GNU_SOURCE leads to definition of _BSD_SOURCE which wastes the (global) namespace with macros having commonly used names (e.g. major, minor).

I have read issue #2082, but think that features should be enabled more selectively...
>How-To-Repeat:
Try to compile 
----------
#define _POSIX_SOURCE

#include <sys/types.h>

void major() {}
----------

with g++3 and g++2.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list