--- bie.jiuling@... wrote: >
> Ray Kelm <rhk@...> wrote:
> > I don't think it is a bug. It's undefined behavior in C.
> Ok, I should clarify that by change main.c:
> #include <stdio.h>
> extern int common;
> extern void test1(void);
> extern void test2(void);
> int main()
> common = 10;
> printf("in main %d\n", common);
> Compile it and link with test1.o and test2.o, printf still shows: "in
> test1 0".
> What do you think the behavior in linux? Should binutils behave
> differently upon
> same cpu with so simple code? The bevavior should be defined with a
> compiler suite, now is GNU.
FWIW, using your test case, I get the same bug as you with as-2.10.1
release built with mingw on W32, but *not* with older binutils-2.9.4 or
recent CVS binutils 2.10.91, also built w/ mingw.
http://clubs.yahoo.com.au - Yahoo! Clubs
- Join a club or build your own!
Get latest updates about Open Source Projects, Conferences and News.