This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]