mirror of
https://github.com/frida/tinycc
synced 2024-12-24 22:16:49 +03:00
Support attribute between double pointer stars
"int * __attribute__((something)) *" is supported by GCC.
This commit is contained in:
parent
662338f116
commit
5d0c16a884
9
tccgen.c
9
tccgen.c
@ -3859,15 +3859,16 @@ static void type_decl(CType *type, AttributeDef *ad, int *v, int td)
|
||||
case TOK_RESTRICT2:
|
||||
case TOK_RESTRICT3:
|
||||
goto redo;
|
||||
/* XXX: clarify attribute handling */
|
||||
case TOK_ATTRIBUTE1:
|
||||
case TOK_ATTRIBUTE2:
|
||||
parse_attribute(ad);
|
||||
break;
|
||||
}
|
||||
mk_pointer(type);
|
||||
type->t |= qualifiers;
|
||||
}
|
||||
|
||||
/* XXX: clarify attribute handling */
|
||||
if (tok == TOK_ATTRIBUTE1 || tok == TOK_ATTRIBUTE2)
|
||||
parse_attribute(ad);
|
||||
|
||||
/* recursive type */
|
||||
/* XXX: incorrect if abstract type for functions (e.g. 'int ()') */
|
||||
type1.t = 0; /* XXX: same as int */
|
||||
|
@ -3031,3 +3031,10 @@ void attrib_test(void)
|
||||
printf("attr: %d %d\n", sizeof(Spacked3), sizeof(spacked3));
|
||||
#endif
|
||||
}
|
||||
extern __attribute__((__unused__)) char * __attribute__((__unused__)) *
|
||||
strange_attrib_placement (void);
|
||||
|
||||
void * __attribute__((__unused__)) get_void_ptr (void *a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user