C++ warnings vs. errors

2008-06-11 Thread Volker Reichelt
Hi, since Manuel's patch http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00962.html a lot of C++ code is now accepted on mainline (when compiling without special flags like -fpermissive and -pedantic), that used to be rejected. Instead of getting closer to the standard we get away from it, which is a

Re: C++ warnings vs. errors

2008-06-11 Thread Ian Lance Taylor
Volker Reichelt <[EMAIL PROTECTED]> writes: > since Manuel's patch http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00962.html > a lot of C++ code is now accepted on mainline (when compiling without > special flags like -fpermissive and -pedantic), that used to be rejected. > Instead of getting closer

Re: C++ warnings vs. errors

2008-06-11 Thread Manuel López-Ibáñez
2008/6/11 Ian Lance Taylor <[EMAIL PROTECTED]>: > Volker Reichelt <[EMAIL PROTECTED]> writes: > >> since Manuel's patch http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00962.html >> a lot of C++ code is now accepted on mainline (when compiling without >> special flags like -fpermissive and -pedantic),

Re: C++ warnings vs. errors

2008-06-11 Thread Joe Buck
On Wed, Jun 11, 2008 at 04:12:18PM +0200, Volker Reichelt wrote: > * Scopes in for-loops: > > void foo() > { > for (int i=0; i<10; ++i) {} > i = 0; > } > > warn.cc: In function 'void foo()': > warn.cc:4: warning: name lookup of 'i' changed for new ISO 'for' scoping > warn.cc:3

Re: C++ warnings vs. errors

2008-06-11 Thread Jonathan Wakely
Hi Volker, thanks for picking these issues up. I told Manuel I'd review the rest of the remaining pedwarns, but haven't had time to do it either. 2008/6/11 Volker Reichelt: > * Scopes in for-loops: > > void foo() > { >for (int i=0; i<10; ++i) {} >i = 0; > } > > warn.cc: In function 'vo

Re: C++ warnings vs. errors

2008-06-13 Thread Mark Mitchell
Jonathan Wakely wrote: Hi Volker, thanks for picking these issues up. I told Manuel I'd review the rest of the remaining pedwarns, but haven't had time to do it either. Just to chime in here: Volker, I agree with your comments. Jonathan, Manuel, if you would please make the time to finish this

Re: C++ warnings vs. errors

2008-06-13 Thread Manuel López-Ibáñez
2008/6/13 Mark Mitchell <[EMAIL PROTECTED]>: > Jonathan Wakely wrote: >> >> Hi Volker, thanks for picking these issues up. I told Manuel I'd >> review the rest of the remaining pedwarns, but haven't had time to do >> it either. > > Just to chime in here: Volker, I agree with your comments. > > Jona

Re: C++ warnings vs. errors

2008-06-15 Thread Jonathan Wakely
2008/6/13 Mark Mitchell: > Jonathan Wakely wrote: >> >> Hi Volker, thanks for picking these issues up. I told Manuel I'd >> review the rest of the remaining pedwarns, but haven't had time to do >> it either. > > Just to chime in here: Volker, I agree with your comments. I think we all do :-) > Jo

Re: C++ warnings vs. errors

2008-06-15 Thread Mark Mitchell
Jonathan -- Thanks for pushing this forward! -- Mark Mitchell CodeSourcery [EMAIL PROTECTED] (650) 331-3385 x713 On Jun 15, 2008, at 7:06 PM, "Jonathan Wakely" <[EMAIL PROTECTED]> wrote: 2008/6/13 Mark Mitchell: Jonathan Wakely wrote: Hi Volker, thanks for picking these issues up. I tol

Re: C++ warnings vs. errors

2008-06-16 Thread Manuel López-Ibáñez
2008/6/16 Jonathan Wakely <[EMAIL PROTECTED]>: > 2008/6/13 Mark Mitchell: >> Jonathan Wakely wrote: >>> >>> Hi Volker, thanks for picking these issues up. I told Manuel I'd >>> review the rest of the remaining pedwarns, but haven't had time to do >>> it either. >> >> Just to chime in here: Volker,

Re: C++ warnings vs. errors

2008-06-17 Thread Jonathan Wakely
2008/6/12 Jonathan Wakely: > 2008/6/11 Volker Reichelt: >> * Scopes in for-loops: >> >> void foo() >> { >>for (int i=0; i<10; ++i) {} >>i = 0; >> } >> >> warn.cc: In function 'void foo()': >> warn.cc:4: warning: name lookup of 'i' changed for new ISO 'for' scoping >> warn.cc:3: warnin

Re: C++ warnings vs. errors

2008-06-18 Thread Mark Mitchell
Jonathan Wakely wrote: Could a C++ maintainer please review this patch to turn most pedwarns into permerrors. This patch is OK, with minor nits below. Thanks for working on this! The interesting cases are: * when 'main' is declared without a return type. I split one case into a permerror an

Re: C++ warnings vs. errors

2008-06-19 Thread Jonathan Wakely
2008/6/18 Mark Mitchell: > Jonathan Wakely wrote: > >> Could a C++ maintainer please review this patch to turn most pedwarns >> into permerrors. > > This patch is OK, with minor nits below. Thanks for working on this! Thanks Mark, I'll submit a revised patch this evening. Jonathan

Re: C++ warnings vs. errors

2008-06-19 Thread Jonathan Wakely
2008/6/18 Mark Mitchell: >> * I don't think the pedwarn in joust() in cp/call.c should be a >> permerror, is this a GNU extension? >> if (warn) >>{ >> pedwarn ("\ >> ISO C++ says that these are ambiguous, even \ >> though the worst conversion for the first is bette

Re: C++ warnings vs. errors

2008-06-19 Thread Mark Mitchell
Jonathan Wakely wrote: 2008/6/18 Mark Mitchell: * I don't think the pedwarn in joust() in cp/call.c should be a permerror, is this a GNU extension? if (warn) { pedwarn ("\ ISO C++ says that these are ambiguous, even \ though the worst conversion for the first is

Re: C++ warnings vs. errors

2008-06-19 Thread Jonathan Wakely
Thanks for the review, here's another patch ... 2008/6/18 Mark Mitchell: > >> * Should it really be a hard error for a class to declare itself as a >> friend? I don't think it's expressly forbidden >> e.g. class A { friend class A; }; >> I changed this to a permerror, restoring the old behaviour.

Re: C++ warnings vs. errors

2008-06-20 Thread Gabriel Dos Reis
On Thu, Jun 19, 2008 at 5:08 PM, Jonathan Wakely <[EMAIL PROTECTED]> wrote: > 2008/6/18 Mark Mitchell: >>> * I don't think the pedwarn in joust() in cp/call.c should be a >>> permerror, is this a GNU extension? >>> if (warn) >>>{ >>> pedwarn ("\ >>> ISO C++ says th

Re: C++ warnings vs. errors

2008-06-20 Thread Mark Mitchell
Jonathan Wakely wrote: Thanks for the review, here's another patch ... Shall I commit this? Yes, please. -- Mark Mitchell CodeSourcery [EMAIL PROTECTED] (650) 331-3385 x713

Re: C++ warnings vs. errors

2008-06-21 Thread Jonathan Wakely
2008/6/20 Mark Mitchell: > >> Shall I commit this? > > Yes, please. Thanks, Mark, I've committed it. Volker, all the problems you noticed should be fixed, if you find any other cases that seem wrong please let me know. Cheers, Jonathan