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:
Thomas Preud'homme 2010-04-13 21:08:37 +02:00
parent 47abdbd3d5
commit e9406c09a3

View File

@ -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;