Patch to deprecate casts as lvalues for C

Gabriel Dos Reis gdr@integrable-solutions.net
Wed Oct 22 23:43:00 GMT 2003


"Zack Weinberg" <zack@codesourcery.com> writes:

| Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
| 
| > |  I fail to see the  problem.
| >
| > The problem is inappropriate use of pedwarn.  If you don't want the
| > diagnostic to turn into an error if -pedantic, don't use it. Use warning.
| 
| Your statement is only true for the C++ front end.  The C++ front end
| appears to have dispensed with the distinction between -pedantic and
| -pedantic-errors, which is fine -- but should not be generalized to
| other front ends without due consideration.

I have no intention to generalize C++ behaviour to other front-ends.
I just want to make just that something is not being accidently used.

| Furthermore, since this diagnostic is mandatory (constraint violation,
| C99 6.5.2.4p1 for instance) in the C front end pedantic MUST be used.
| The intent is that -pedantic-errors (but not -pedantic!) should cause
| a hard error for all mandatory diagnostics.
| 
| The code Joseph wrote is correct.

If you and Joseph believe it is correct as is, that is fine.

-- Gaby



More information about the Gcc-patches mailing list