Removing -frwitable-strings
Matt Austern
austern@apple.com
Sat Dec 20 07:08:00 GMT 2003
On Dec 19, 2003, at 12:42 PM, Joseph S. Myers wrote:
> On Fri, 19 Dec 2003, Syd Polk wrote:
>
>> Make -Wwrite-strings on by default. Otherwise, people who port to gcc
>
> The trouble is, it warns for a great deal of reasonably clean
> standards-conforming code, and the changes required to fix those
> warnings
> are more wide-ranging than for -Wall (which it might be more
> reasonable to
> enable by default). In rare cases it may also *remove* diagnostics
> required by the standard as a side effect of giving string literals a
> different type from that the C standard requires.
At the risk of getting boring by repeating myself... This might be an
argument for treating C and C++ differently. The two languages have
different rules about the types of string literals, and it's a lot
harder to
call 'char* p = "foo"' clean code in C++ than it is in C.
--Matt
More information about the Gcc
mailing list