This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in gcc
- From: Marcus Meissner <meissner at suse dot de>
- To: Swaminathan Venkatakrishnaprasad <vswami at agere dot com>
- Cc: bug-gcc at prep dot ai dot mit dot edu
- Date: Thu, 13 Feb 2003 17:23:34 +0100
- Subject: Re: Bug in gcc
- References: <00ae01c2d37b$498ed210$ddb65e80@agere.com>
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