This is the mail archive of the 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]
Other format: [Raw text]

Changes in C++ FE regarding pedwarns to be errors are harmful

Hi all,

Looks like gcc 4.3 has some rather inconvenient changes in C++ FE, with the 
latest trunk. Lets see with an example :

[~]> cat test.cpp
#define foo bar
#define foo baz

[~]> g++ -c test.cpp
test.cpp:2:1: error: "foo" redefined
test.cpp:1:1: error: this is the location of the previous definition

I don't know the reasoning behind this change but this breaks many C++ 
programs unless -fpermissive is used. Why? Because everybody loves to install 
their own config.h (Python, libmp4v2 being nice examples) which just 
carelessly #define anything its asked for with ifndef ... endif .

Now flash back to real world: this breaks any C++ application that uses 
Python, libmp4v2, libjpeg and possibly many others. And I think this is a 
real bad behaviour change and I am not sure if its worth all the trouble.

So I am asking, would C++ FE maintainers would agree to revert this into a 
warning as in C FE now.

I welcome and value your comments, so please speak up.


Never learn by your mistakes, if you do you may never dare to try again.

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