diff options
| author | Michael Matz <matz@suse.de> | 2017-07-10 22:20:34 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2017-07-10 22:20:34 +0200 |
| commit | 2240422da9b55b71cfb32220bb0246ec92bfc432 (patch) | |
| tree | d1f9ad8ad518efd9244d45b4a6f0df8b27729340 /tccgen.c | |
| parent | a9e502cc3bae649fe4f9adffcd0715eb0a71d085 (diff) | |
| download | tinycc-2240422da9b55b71cfb32220bb0246ec92bfc432.tar.gz tinycc-2240422da9b55b71cfb32220bb0246ec92bfc432.tar.bz2 | |
enums: Accept GNU extension
See testcase. Happens e.g. in the linux kernel.
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3683,7 +3683,7 @@ static void struct_decl(CType *type, int u) v = anon_sym++; } /* Record the original enum/struct/union token. */ - type1.t = u; + type1.t = u == VT_ENUM ? u | VT_INT | VT_UNSIGNED : u; type1.ref = NULL; /* we put an undefined size for struct/union */ s = sym_push(v | SYM_STRUCT, &type1, 0, -1); @@ -3736,7 +3736,7 @@ do_decl: skip('}'); /* set integral type of the enum */ t.t = VT_INT; - if (nl == 0) { + if (nl >= 0) { if (pl != (unsigned)pl) t.t = VT_LLONG; t.t |= VT_UNSIGNED; |
