This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: question about operator priority
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Yongming wei <weiyongming2001 at yahoo dot com dot cn>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 1 Jan 2003 07:26:19 +0000
- Subject: Re: question about operator priority
- References: <20030101070039.19518.qmail@web15005.mail.bjs.yahoo.com>
Yongming wei wrote:-
> hi all,
>
> This is a quesiton about priority of operator in c, I
> have a simple program:
>
> #include <stdio.h>
>
> main()
> {
> int i = 1;
> i = i + ++i;
> printf("%d\n",i);
> }
>
> the result is 4 in my redhat 7.3, I think the compiler
Undefined behaviour.
Neil.