This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/57647] lvalue required as increment operand
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Jun 2013 07:23:18 +0000
- Subject: [Bug c/57647] lvalue required as increment operand
- Auto-submitted: auto-generated
- References: <bug-57647-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
While 4.7 issues warning: value computed is not used, 4.8 and 4.9 do not for
int
main ()
{
char bar = 4;
char *foo = &bar;
(unsigned long *)foo++;
return 0;
}
For 4.7, you can just add cast to void
(void) (unsigned long *)foo++;
to silence the warning.