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

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


On 1/8/08, Ismail DÃnmez <ismail@pardus.org.tr> wrote:
> Tuesday 08 January 2008 23:34:13 tarihinde Joe Buck ÅunlarÄ yazmÄÅtÄ:
> > There's certainly an argument that this change is ill-advised. However,
> > your statements in the last paragraph aren't true: most quality open
> > source projects have a "no warnings" rule (or at least try to eliminate
> > warnings), and most programmers know about #undef.
>
> Interesting assumption because knowing about #undef doesn't cut it because
> autoconf will happily #define without ifndef etc.

The other thing is before this change, the C++ front-end was
inconstaint with the preprocessor and now it is constaint.  So adding
-pedantic-errors made those warnings into errors while doing
-pedantic-errors -fpermissive will still kept them as errors.
As shown by:

apinski@debian:~$ ~/x86-linux-4.0.2/bin/gcc t.cc -pedantic-errors -fpermissive
t.cc:2:1: error: "a" redefined
t.cc:1:1: error: this is the location of the previous definition
apinski@debian:~$ ~/x86-linux-4.0.2/bin/gcc t.cc
t.cc:2:1: warning: "a" redefined
t.cc:1:1: warning: this is the location of the previous definition
/usr/lib/crt1.o(.text+0x18): In function `_start':
../sysdeps/i386/elf/start.S:98: undefined reference to `main'
collect2: ld returned 1 exit status

Thanks,
Andrew Pinski

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