aboutsummaryrefslogtreecommitdiff
path: root/tests/tests2/03_struct.c
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2015-03-03 15:00:13 +0300
committerseyko <seyko2@gmail.com>2015-03-03 15:00:13 +0300
commitbbf8221ec35d6197c8b717940fd0a24d1956e507 (patch)
tree901869d323bd39049c6b62b39f9cbe8257c3e391 /tests/tests2/03_struct.c
parenta429d40f067cdbbd4673c9e88d1fb6f93ac8a7e0 (diff)
downloadtinycc-bbf8221ec35d6197c8b717940fd0a24d1956e507.tar.gz
tinycc-bbf8221ec35d6197c8b717940fd0a24d1956e507.tar.bz2
tcc don't understand am extern array of structs.
A regression was found trying to compile a linux kernel 2.4.26 which can be compiled by tcc 0.9.23 /////////////////// #include <stdio.h> // test for a bug: // compiler don't understand am extern array of structs // $ tcc test_1.c // test_1.c:8: error: unknown struct/union/enum extern struct FILE std_files[4]; int main() { return 0; } ////////////////// tcc-current /* enum/struct/union declaration. u is either VT_ENUM or VT_STRUCT */ static void struct_decl(CType *type, int u, int tdef) ... if (tok != '{') { v = tok; next(); /* struct already defined ? return it */ if (v < TOK_IDENT) expect("struct/union/enum name"); s = struct_find(v); if (s) { if (s->type.t != a) tcc_error("invalid type"); goto do_decl; } else if (tok >= TOK_IDENT && !tdef) tcc_error("unknown struct/union/enum"); } else { v = anon_sym++; } tcc-0.9.23 which don't have such error /* enum/struct/union declaration. u is either VT_ENUM or VT_STRUCT */ static void struct_decl(CType *type, int u) .... if (tok != '{') { v = tok; next(); /* struct already defined ? return it */ if (v < TOK_IDENT) expect("struct/union/enum name"); s = struct_find(v); if (s) { if (s->type.t != a) error("invalid type"); goto do_decl; } } else { v = anon_sym++; }
Diffstat (limited to 'tests/tests2/03_struct.c')
0 files changed, 0 insertions, 0 deletions