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 is a rewrite ofe9406c09a3
but considering problems raised about static local function pointers in632ee5a540
.
This commit is contained in:
parent
3b4b3b75a6
commit
cf36410e30
4
tccgen.c
4
tccgen.c
@ -5423,6 +5423,10 @@ ST_FUNC void decl(int l)
|
||||
while (1) { /* iterate thru each declaration */
|
||||
type = btype;
|
||||
type_decl(&type, &ad, &v, TYPE_DIRECT);
|
||||
if (((type.t & (VT_STATIC|VT_FUNC)) == (VT_STATIC|VT_FUNC))
|
||||
&& (l == VT_LOCAL)) {
|
||||
error("Function without file scope cannot be static");
|
||||
}
|
||||
#if 0
|
||||
{
|
||||
char buf[500];
|
||||
|
Loading…
Reference in New Issue
Block a user