Fix incorrect use of basic types as bitflags and inefficiency in commit cf36410e30b3c18be6c556158b2d0d0938f5b77d
Unified · Split
| @@ -5423,10 +5423,6 @@ ST_FUNC void decl(int l) · 5422 unmodified lines | ||
| 5423 | 5423 | while (1) { /* iterate thru each declaration */ |
| 5424 | 5424 | type = btype; |
| 5425 | 5425 | type_decl(&type, &ad, &v, TYPE_DIRECT); |
| 5426 | − if (((type.t & (VT_STATIC|VT_FUNC)) == (VT_STATIC|VT_FUNC)) | |
| 5427 | − && (l == VT_LOCAL)) { | |
| 5428 | − error("Function without file scope cannot be static"); | |
| 5429 | − } | |
| 5430 | 5426 | #if 0 |
| 5431 | 5427 | { |
| 5432 | 5428 | char buf[500]; |
| @@ -5435,6 +5431,9 @@ ST_FUNC void decl(int l) · 2 unmodified lines | ||
| 5435 | 5431 | } |
| 5436 | 5432 | #endif |
| 5437 | 5433 | if ((type.t & VT_BTYPE) == VT_FUNC) { |
| 5434 | + if ((type.t & VT_STATIC) && (l == VT_LOCAL)) { | |
| 5435 | + error("function without file scope cannot be static"); | |
| 5436 | + } | |
| 5438 | 5437 | /* if old style function prototype, we accept a |
| 5439 | 5438 | declaration list */ |
| 5440 | 5439 | sym = type.ref; |