History

collapse branch in decl(), making way for next patch

Joe Soroka committed 15 years ago

Commit ce8c1881 parent 3beb3831 file · +9 −9Browse files

Unified · Split

tccgen.c+9−9
@@ -5560,21 +5560,21 @@ ST_FUNC void decl(int l) · 5559 unmodified lines
55605560 /* XXX: test storage specifiers ? */
55615561 sym = sym_push(v, &type, INT_ATTR(&ad), 0);
55625562 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);
55685563 } else {
5569− /* not lvalue if array */
55705564 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 */
55725571 r |= lvalue_type(type.t);
5572+ }
55735573 has_init = (tok == '=');
5574− if ((btype.t & VT_EXTERN) ||
5574+ if ((btype.t & VT_EXTERN) || ((type.t & VT_BTYPE) == VT_FUNC) ||
55755575 ((type.t & VT_ARRAY) && (type.t & VT_STATIC) &&
55765576 !has_init && l == VT_CONST && type.ref->c < 0)) {
5577− /* external variable */
5577+ /* external variable or function */
55785578 /* NOTE: as GCC, uninitialized global static
55795579 arrays of null size are considered as
55805580 extern */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t