lkml.org 
[lkml]   [1998]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Egcs 1.0.3 & Linux
CW> > Unfortunatelly "bug in source code" is VERY VERY week conception. Simple
CW> > example:
CW> >
CW> > #include <stdio.h>
CW> > int a=0;
CW> > int f(void) { a=1;return 1; }
CW> > void main(void) { printf("%d",f()+a); }
CW>
CW> I was under the impression that in the case of equal operator precedence the
CW> order was defined to be strictly left to right, so in this case it should
CW> return 2 and never 1.
CW>
Problem not with equal operator. Problem is with plus operator. Compiler has
right to extract value of "a" first, to call f() next and to sum extracted value
(0) with result of function all (1). Result, of course, will be 1.




-
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:0.068 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site