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 ofe9406c09a3but considering problems raised about static local function pointers in632ee5a540.
This commit is contained in:
4
tccgen.c
4
tccgen.c
@ -5423,6 +5423,10 @@ ST_FUNC void decl(int l)
|
|||||||
while (1) { /* iterate thru each declaration */
|
while (1) { /* iterate thru each declaration */
|
||||||
type = btype;
|
type = btype;
|
||||||
type_decl(&type, &ad, &v, TYPE_DIRECT);
|
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
|
#if 0
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|||||||
Reference in New Issue
Block a user