Re: output difference between VC and gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



        printf("%d:%d\n",i,tab[i++]);

based on C standard, whose output is correct?

The program exhibits undefined behaviour: it reads "i" twice while also
writing it, without any intervening sequence point.  See e.g. 6.5/2 in
the C99 standard.


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux