lkml.org 
[lkml]   [1998]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: Egcs 1.0.3 & Linux
    Date
    From
    > #include <stdio.h>
    > int a=0;
    > int f(void) { a=1;return 1; }
    > void main(void) { printf("%d",f()+a); }

    chris@cybernet.co.nz said:
    > I was under the impression that in the case of equal operator
    > precedence the order was defined to be strictly left to right, so in
    > this case it should return 2 and never 1.

    There is nothing in the standard that says a must be evaluated before
    b in (a+b). What it says is that (a+b) must be evaluated before a+b+c
    can be evaluated. It is even legitimate in the latter case for c to be
    evaluated before a, but it cannot be added to a, it must be added to (a+b).

    Right?



    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu

    \
     
     \ /
      Last update: 2005-03-22 13:42    [W:8.724 / U:0.616 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site