[Bug c/57647] lvalue required as increment operand

vijunag at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jun 19 07:34:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647

--- Comment #2 from vijay Nag <vijunag at gmail dot com> ---
(In reply to Marek Polacek from comment #1)
> 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.

Does it work only for int or any type ?



More information about the Gcc-bugs mailing list