Bug in gcc

Marcus Meissner meissner@suse.de
Thu Feb 13 16:24:00 GMT 2003


On Thu, Feb 13, 2003 at 11:16:38AM -0500, Swaminathan Venkatakrishnaprasad wrote:
> Hello,
> 
> The program below when excuted yields incorrect result:
> 
> main()
> {
>    int A,B,C;
> 
>    A=0; B=1;C=2;
> 
>    A = B++ + B++ + C++ + C++;

You are modifying C twice, this is undefined behaviour.

Ciao, Marcus



More information about the Gcc-bugs mailing list