Fixed check for conflicting extern vs no-linkage/static declarations in functions.
This commit is contained in:
8
test/err/bug2162-none-extern-auto.c
Normal file
8
test/err/bug2162-none-extern-auto.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* Bug #2162 - conflicting declarations in functions */
|
||||
|
||||
int main(void)
|
||||
{
|
||||
extern int i;
|
||||
int i = 42; /* Error */
|
||||
return i;
|
||||
}
|
||||
8
test/err/bug2162-none-static-extern.c
Normal file
8
test/err/bug2162-none-static-extern.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* Bug #2162 - conflicting declarations in functions */
|
||||
|
||||
int main(void)
|
||||
{
|
||||
static int i = 42;
|
||||
extern int i; /* Error */
|
||||
return i;
|
||||
}
|
||||
10
test/err/bug2162-static-extern-auto.c
Normal file
10
test/err/bug2162-static-extern-auto.c
Normal file
@@ -0,0 +1,10 @@
|
||||
/* Bug #2162 - conflicting declarations in functions */
|
||||
|
||||
static int i;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
extern int i; /* cc65 allows this */
|
||||
int i = 42; /* Error - if this were accepted, it would be confusing which object i refers to */
|
||||
return i;
|
||||
}
|
||||
10
test/err/bug2162-static-static-extern.c
Normal file
10
test/err/bug2162-static-static-extern.c
Normal file
@@ -0,0 +1,10 @@
|
||||
/* Bug #2162 - conflicting declarations in functions */
|
||||
|
||||
static int i;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
static int i = 42; /* OK - this shadows the i in file scope */
|
||||
extern int i; /* Error - if this were accepted, it would be confusing which object i refers to */
|
||||
return i;
|
||||
}
|
||||
Reference in New Issue
Block a user