mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-27 06:10:06 +08:00
collapse branch in decl(), making way for next patch
This commit is contained in:
parent
3beb383236
commit
ce8c1886a5
18
tccgen.c
18
tccgen.c
@ -5560,21 +5560,21 @@ ST_FUNC void decl(int l)
|
|||||||
/* XXX: test storage specifiers ? */
|
/* XXX: test storage specifiers ? */
|
||||||
sym = sym_push(v, &type, INT_ATTR(&ad), 0);
|
sym = sym_push(v, &type, INT_ATTR(&ad), 0);
|
||||||
sym->type.t |= VT_TYPEDEF;
|
sym->type.t |= VT_TYPEDEF;
|
||||||
} else if ((type.t & VT_BTYPE) == VT_FUNC) {
|
|
||||||
/* external function definition */
|
|
||||||
/* specific case for func_call attribute */
|
|
||||||
type.ref->r = INT_ATTR(&ad);
|
|
||||||
external_sym(v, &type, 0, asm_label);
|
|
||||||
} else {
|
} else {
|
||||||
/* not lvalue if array */
|
|
||||||
r = 0;
|
r = 0;
|
||||||
if (!(type.t & VT_ARRAY))
|
if ((type.t & VT_BTYPE) == VT_FUNC) {
|
||||||
|
/* external function definition */
|
||||||
|
/* specific case for func_call attribute */
|
||||||
|
type.ref->r = INT_ATTR(&ad);
|
||||||
|
} else if (!(type.t & VT_ARRAY)) {
|
||||||
|
/* not lvalue if array */
|
||||||
r |= lvalue_type(type.t);
|
r |= lvalue_type(type.t);
|
||||||
|
}
|
||||||
has_init = (tok == '=');
|
has_init = (tok == '=');
|
||||||
if ((btype.t & VT_EXTERN) ||
|
if ((btype.t & VT_EXTERN) || ((type.t & VT_BTYPE) == VT_FUNC) ||
|
||||||
((type.t & VT_ARRAY) && (type.t & VT_STATIC) &&
|
((type.t & VT_ARRAY) && (type.t & VT_STATIC) &&
|
||||||
!has_init && l == VT_CONST && type.ref->c < 0)) {
|
!has_init && l == VT_CONST && type.ref->c < 0)) {
|
||||||
/* external variable */
|
/* external variable or function */
|
||||||
/* NOTE: as GCC, uninitialized global static
|
/* NOTE: as GCC, uninitialized global static
|
||||||
arrays of null size are considered as
|
arrays of null size are considered as
|
||||||
extern */
|
extern */
|
||||||
|
Loading…
Reference in New Issue
Block a user