Fixed visibility of undeclared functions and objects.

This commit is contained in:
acqn
2024-01-13 00:46:14 +08:00
parent a173428fab
commit 3d0dc58153
6 changed files with 78 additions and 21 deletions

View 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;
}