Fixed visibility of undeclared functions and objects.
This commit is contained in:
21
test/misc/bug2304-implicit-func.c
Normal file
21
test/misc/bug2304-implicit-func.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/* Bug 2304 - Visibility of objects/functions undeclared in file scope but 'extern'-declared in unrelated block scopes */
|
||||
|
||||
/* This one should fail even in C89 */
|
||||
|
||||
void f1(void)
|
||||
{
|
||||
extern unsigned int f();
|
||||
}
|
||||
|
||||
/* 'f' is still invisible in the file scope */
|
||||
|
||||
int main(void)
|
||||
{
|
||||
f(); /* Should be a conflict since the implicit function type is incompatible */
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int f()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
Reference in New Issue
Block a user