mirror of
https://github.com/frida/tinycc
synced 2024-11-24 08:39:37 +03:00
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
3
tccgen.c
3
tccgen.c
@ -2985,6 +2985,9 @@ static void post_type(CType *type, AttributeDef *ad)
|
|||||||
|
|
||||||
if (tok == '(') {
|
if (tok == '(') {
|
||||||
/* function declaration */
|
/* function declaration */
|
||||||
|
if ((type->t & VT_STATIC) && local_stack) {
|
||||||
|
error("Function without file scope cannot be static");
|
||||||
|
}
|
||||||
next();
|
next();
|
||||||
l = 0;
|
l = 0;
|
||||||
first = NULL;
|
first = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user