This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question about operator priority


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]