Unified · Split
| @@ -5560,21 +5560,21 @@ ST_FUNC void decl(int l) · 5559 unmodified lines | ||
| 5560 | 5560 | /* XXX: test storage specifiers ? */ |
| 5561 | 5561 | sym = sym_push(v, &type, INT_ATTR(&ad), 0); |
| 5562 | 5562 | sym->type.t |= VT_TYPEDEF; |
| 5563 | − } else if ((type.t & VT_BTYPE) == VT_FUNC) { | |
| 5564 | − /* external function definition */ | |
| 5565 | − /* specific case for func_call attribute */ | |
| 5566 | − type.ref->r = INT_ATTR(&ad); | |
| 5567 | − external_sym(v, &type, 0, asm_label); | |
| 5568 | 5563 | } else { |
| 5569 | − /* not lvalue if array */ | |
| 5570 | 5564 | r = 0; |
| 5571 | − if (!(type.t & VT_ARRAY)) | |
| 5565 | + if ((type.t & VT_BTYPE) == VT_FUNC) { | |
| 5566 | + /* external function definition */ | |
| 5567 | + /* specific case for func_call attribute */ | |
| 5568 | + type.ref->r = INT_ATTR(&ad); | |
| 5569 | + } else if (!(type.t & VT_ARRAY)) { | |
| 5570 | + /* not lvalue if array */ | |
| 5572 | 5571 | r |= lvalue_type(type.t); |
| 5572 | + } | |
| 5573 | 5573 | has_init = (tok == '='); |
| 5574 | − if ((btype.t & VT_EXTERN) || | |
| 5574 | + if ((btype.t & VT_EXTERN) || ((type.t & VT_BTYPE) == VT_FUNC) || | |
| 5575 | 5575 | ((type.t & VT_ARRAY) && (type.t & VT_STATIC) && |
| 5576 | 5576 | !has_init && l == VT_CONST && type.ref->c < 0)) { |
| 5577 | − /* external variable */ | |
| 5577 | + /* external variable or function */ | |
| 5578 | 5578 | /* NOTE: as GCC, uninitialized global static |
| 5579 | 5579 | arrays of null size are considered as |
| 5580 | 5580 | extern */ |