[Bug c/59264] Incorrect order of execution on increament/decrement operator
smaheshs41 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Nov 23 17:13:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59264
--- Comment #3 from Mahesh S <smaheshs41 at gmail dot com> ---
but it gets executed correctly for 1st condition why not for 2nd and 3rd
On Sat, Nov 23, 2013 at 10:36 PM, redi at gcc dot gnu.org <
gcc-bugzilla@gcc.gnu.org> wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59264
>
> Jonathan Wakely <redi at gcc dot gnu.org> changed:
>
> What |Removed |Added
>
> ----------------------------------------------------------------------------
> Status|UNCONFIRMED |RESOLVED
> Resolution|--- |INVALID
>
> --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
> Instead of reporting a bug, try turning warnings on and fixing them, the
> compiler tells you what's wrong with your code:
>
> t.c:2:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
> void main()
> ^
> t.c: In function ‘main’:
> t.c:5:3: warning: operation on ‘i’ may be undefined [-Wsequence-point]
> i=++i + ++i + i++;
> ^
> t.c:5:3: warning: operation on ‘i’ may be undefined [-Wsequence-point]
> t.c:5:3: warning: operation on ‘i’ may be undefined [-Wsequence-point]
> t.c:8:3: warning: operation on ‘i’ may be undefined [-Wsequence-point]
> i=i++ + ++i + ++i;
> ^
> t.c:8:3: warning: operation on ‘i’ may be undefined [-Wsequence-point]
> t.c:8:3: warning: operation on ‘i’ may be undefined [-Wsequence-point]
> t.c:11:3: warning: operation on ‘i’ may be undefined [-Wsequence-point]
> i=++i + i++ + ++i;
> ^
> t.c:11:3: warning: operation on ‘i’ may be undefined [-Wsequence-point]
> t.c:11:3: warning: operation on ‘i’ may be undefined [-Wsequence-point]
>
> --
> You are receiving this mail because:
> You reported the bug.
>
More information about the Gcc-bugs
mailing list