Complain for static fct declared w/o file scope
Error out on static function without file scope and give an explaination to the user
This commit is contained in:
parent
47abdbd3d5
commit
e9406c09a3
1 changed files with 3 additions and 0 deletions
3
tccgen.c
3
tccgen.c
|
@ -2985,6 +2985,9 @@ static void post_type(CType *type, AttributeDef *ad)
|
|||
|
||||
if (tok == '(') {
|
||||
/* function declaration */
|
||||
if ((type->t & VT_STATIC) && local_stack) {
|
||||
error("Function without file scope cannot be static");
|
||||
}
|
||||
next();
|
||||
l = 0;
|
||||
first = NULL;
|
||||
|
|
Loading…
Reference in a new issue