c++/890

Joe Buck jbuck@racerx.synopsys.com
Tue Nov 28 10:43:00 GMT 2000


> 
> > Should this error be downgraded to a warning in the presence of
> > -fpermissive?
> 
> Thoughts from the field (which I am out standing in ;-):  I would like 
> to see -fpermissive mean, "if it doesn't effect the output code, it's 
> not an error."

That's not the purpose of the flag; it's to make some constructs that have
long been used work, even though they violate C++ (typically things that
used to be legal, or are legal in C but not C++ and commonly appear in
headers).

The most common use of -fpermissive right now is to be able to accept
X11R6 headers (at least, the original X11R6 headers) in C++ code, even
though they do things like

const foo = 23;

that aren't legal ISO C++ (no type is specified; C defaults to int).

> Any user who turns on the -fpermissive flag knows that 
> they are doing something wacky.

Rather, they are trying to get old code to compile.  That's not so wacky.
No one should be writing new code that needs -fpermissive; it's just a
measure to help ease the transition.


More information about the Gcc mailing list