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

Paolo Bonzini bonzini@gnu.org
Wed Jan 9 14:10:00 GMT 2008


Andrew Pinski wrote:
> On 1/8/08, Ismail Dönmez <ismail@pardus.org.tr> wrote:
>> Oh that clears up my confusion. So the right fix would be downgrading this
>> redefinition problem to be pedwarn instead. But I see no point in creating a
>> bug report if its just gonna be closed as invalid, so I hope we can discuss
>> if its feasible to downgrade this error to be a pedwarn.
> 
> It is already a pedwarn.  Just the C++ front-end enables pedwarn as
> being errors by default and downgrades them as being warnings with
> -fpermissive.  This is the whole point of -fpermissive.

Not at all!!! -fpermissive can (in weird cases, agreed) change code 
generation.  I'm pretty sure you don't want to risk that only to silence 
an error.

I wonder if this requires a new diagnostic category, something like:

   if (pedantic)
     pedwarn ("...")
   else
     warning ("...")

Paolo



More information about the Gcc mailing list