This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to deprecate casts as lvalues for C
"Zack Weinberg" <zack@codesourcery.com> writes:
| Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
|
| > "Zack Weinberg" <zack@codesourcery.com> writes:
| >
| > | Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
| > |
| > | > "Joseph S. Myers" <jsm@polyomino.org.uk> writes:
| > | >
| > | > | + default:
| > | > | + pedwarn ("use of cast expressions as lvalues is deprecated");
| > | >
| > | > Just to be clear: an unconditional pedwarn is an error if
| > | > -pedantic.
| > |
| > | Not in the C front end it isn't.
| >
| > It is therefore C people's responsability to be careful about its use.
| > Which precisely is why I made the remark.
|
| The code you quoted came from the C front end.
I know. That is part of the reason I made the remark.
| 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.
-- Gaby