What is the relationship of #line to global static scope?

Viewed 57

Given a C file (foo.c) as follows:

#line 1 "a.c"
static int bar = 1;
#line 2 "b.c"
static int bar = 2;
#line 2 "a.c"
int foo(){
    return bar;
}

Are the two declarations of bar in the same scope or separate scopes (i.e. would foo() return 1)?

Note: I am interested in the correct behavior based on the standard, not just "what does my compiler do" (hence the language-lawyer tag)

1 Answers
Related