This is the mail archive of the
mailing list for the GCC project.
Changes in C++ FE regarding pedwarns to be errors are harmful
- From: Ismail DÃnmez <ismail at pardus dot org dot tr>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 8 Jan 2008 23:28:22 +0200
- Subject: Changes in C++ FE regarding pedwarns to be errors are harmful
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.