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 of e9406c09a3 but
considering problems raised about static local function pointers in
632ee5a540.
This commit is contained in:
Thomas Preud'homme 2010-04-13 21:08:37 +02:00
parent 3b4b3b75a6
commit cf36410e30

View File

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