This reverts commit e9406c09a3212ab3f120412a6bbdacb0cdd25deb. We don't want errors for static local function pointers, such as: { static void (*fn)(); ... }
Unified · Split
| @@ -2995,9 +2995,6 @@ static void post_type(CType *type, AttributeDef *ad) · 2994 unmodified lines | |||
| 2995 | 2995 | ||
| 2996 | if (tok == '(') { | 2996 | if (tok == '(') { |
| 2997 | /* function declaration */ | 2997 | /* function declaration */ |
| 2998 | if ((type->t & VT_STATIC) && local_stack) { | ||
| 2999 | error("Function without file scope cannot be static"); | ||
| 3000 | } | ||
| 3001 | next(); | 2998 | next(); |
| 3002 | l = 0; | 2999 | l = 0; |
| 3003 | first = NULL; | 3000 | first = NULL; |