mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-24 10:00:07 +08:00
Accept attributes after labels
newer GCC can associate attributes with statements and labels, this implements only the latter (and ignores the attributes).
This commit is contained in:
parent
b077bc8ff7
commit
1da92cdd93
5
tccgen.c
5
tccgen.c
@ -7048,6 +7048,11 @@ again:
|
||||
s->cleanupstate = cur_scope->cl.s;
|
||||
|
||||
block_after_label:
|
||||
{
|
||||
/* Accept attributes after labels (e.g. 'unused') */
|
||||
AttributeDef ad_tmp;
|
||||
parse_attribute(&ad_tmp);
|
||||
}
|
||||
vla_restore(cur_scope->vla.loc);
|
||||
if (tok != '}')
|
||||
goto again;
|
||||
|
@ -30,6 +30,12 @@ int ATTR actual_function() {
|
||||
return 42;
|
||||
}
|
||||
|
||||
int label_attribute (void)
|
||||
{
|
||||
lab1: __attribute__((__unused__));
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern int printf (const char *, ...);
|
||||
static int globalvar;
|
||||
int main()
|
||||
|
Loading…
Reference in New Issue
Block a user