This is the mail archive of the
mailing list for the GCC project.
Re: Patch to deprecate casts as lvalues for C
"Zack Weinberg" <email@example.com> writes:
| Gabriel Dos Reis <firstname.lastname@example.org> 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 184.108.40.206p1 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.