History

work on local extern declarations

Example: int a = 1; void f(void) { int a = 2; { extern int a; // = 1 !! .... To get this (more) correctly there is a new function to copy syms between local to global stacks. Also, this patch changes the meaning of VT_EXTERN back to the simpler and IMO more useful notion of DECLARED but not (yet) DEFINED. and that for both variables and functions. That is, VT_EXTERN in tcc doesn't have to do with the keyword 'extern' necessarily. Also this patch does allow int x[]; as alias for extern int x[]; (as do gcc and msvc)

grischka committed 7 years ago

Commit 85690481 parent cbbba014 files · +214 −86Browse files

Unified · Split

4 files
  1. tccasm.c +1 −1
  2. tccgen.c +103 −82
  3. tests/tests2/60_errors_and_warnings.c +77 −1
  4. tests/tests2/60_errors_and_warnings.expect +33 −2
tccasm.c+1−1
@@ -38,7 +38,7 @@ static Sym* asm_new_label1(TCCState *s1, int label, int is_local, int sh_num, in · 37 unmodified lines
38static Sym *asm_label_find(int v)38static Sym *asm_label_find(int v)
39{39{
40 Sym *sym = sym_find(v);40 Sym *sym = sym_find(v);
41 while (sym && sym->sym_scope)41 while (sym && sym->sym_scope && !(sym->type.t & VT_STATIC))
42 sym = sym->prev_tok;42 sym = sym->prev_tok;
43 return sym;43 return sym;
44}44}
tccgen.c+103−82
@@ -263,6 +263,7 @@ ST_FUNC int tccgen_compile(TCCState *s1) · 262 unmodified lines
263 section_sym = 0;263 section_sym = 0;
264 const_wanted = 0;264 const_wanted = 0;
265 nocode_wanted = 0x80000000;265 nocode_wanted = 0x80000000;
266 local_scope = 0;
266 267
267 /* define some often used types */268 /* define some often used types */
268 int_type.t = VT_INT;269 int_type.t = VT_INT;
@@ -325,8 +326,7 @@ ST_FUNC void update_storage(Sym *sym) · 56 unmodified lines
325 esym->st_other = (esym->st_other & ~ELFW(ST_VISIBILITY)(-1))326 esym->st_other = (esym->st_other & ~ELFW(ST_VISIBILITY)(-1))
326 | sym->a.visibility;327 | sym->a.visibility;
327 328
328 if ((sym->type.t & VT_STATIC)329 if (sym->type.t & (VT_STATIC | VT_INLINE))
329 || (sym->type.t & (VT_EXTERN | VT_INLINE)) == VT_INLINE)
330 sym_bind = STB_LOCAL;330 sym_bind = STB_LOCAL;
331 else if (sym->a.weak)331 else if (sym->a.weak)
332 sym_bind = STB_WEAK;332 sym_bind = STB_WEAK;
@@ -408,7 +408,7 @@ ST_FUNC void put_extern_sym2(Sym *sym, int sh_num, · 75 unmodified lines
408 } else {408 } else {
409 sym_type = STT_OBJECT;409 sym_type = STT_OBJECT;
410 }410 }
411 if ((t & VT_STATIC) || (t & (VT_EXTERN | VT_INLINE)) == VT_INLINE)411 if (t & (VT_STATIC | VT_INLINE))
412 sym_bind = STB_LOCAL;412 sym_bind = STB_LOCAL;
413 else413 else
414 sym_bind = STB_GLOBAL;414 sym_bind = STB_GLOBAL;
@@ -927,8 +927,7 @@ static void merge_attr(AttributeDef *ad, AttributeDef *ad1) · 512 unmodified lines
927/* Merge some type attributes. */927/* Merge some type attributes. */
928static void patch_type(Sym *sym, CType *type)928static void patch_type(Sym *sym, CType *type)
929{929{
930 if ((!(type->t & VT_EXTERN) || IS_ENUM_VAL(sym->type.t))930 if (!(type->t & VT_EXTERN) || IS_ENUM_VAL(sym->type.t)) {
931 && (type->t & VT_BTYPE) != VT_FUNC) {
932 if (!(sym->type.t & VT_EXTERN))931 if (!(sym->type.t & VT_EXTERN))
933 tcc_error("redefinition of '%s'", get_tok_str(sym->v, NULL));932 tcc_error("redefinition of '%s'", get_tok_str(sym->v, NULL));
934 sym->type.t &= ~VT_EXTERN;933 sym->type.t &= ~VT_EXTERN;
@@ -955,29 +954,30 @@ static void patch_type(Sym *sym, CType *type) · 20 unmodified lines
955 tcc_warning("static storage ignored for redefinition of '%s'",954 tcc_warning("static storage ignored for redefinition of '%s'",
956 get_tok_str(sym->v, NULL));955 get_tok_str(sym->v, NULL));
957 956
958 /* Force external definition if unequal inline specifier957 /* set 'inline' if both agree or if one has static */
959 or an explicit extern one. */958 if ((type->t | sym->type.t) & VT_INLINE) {
960 if ((sym->type.t | type->t) & VT_STATIC) {959 if (!((type->t ^ sym->type.t) & VT_INLINE)
961 type->t |= sym->type.t & VT_INLINE;960 || ((type->t | sym->type.t) & VT_STATIC))
962 sym->type.t |= type->t & VT_INLINE;961 static_proto |= VT_INLINE;
963 } else if (((type->t & VT_INLINE) != (sym->type.t & VT_INLINE)
964 || (type->t | sym->type.t) & VT_EXTERN)
965 && !static_proto) {
966 type->t &= ~VT_INLINE;
967 sym->type.t &= ~VT_INLINE;
968 }962 }
963
969 if (0 == (type->t & VT_EXTERN)) {964 if (0 == (type->t & VT_EXTERN)) {
970 /* put complete type, use static from prototype, but don't965 /* put complete type, use static from prototype */
971 overwrite type.ref, it might contain parameter names */966 sym->type.t = (type->t & ~(VT_STATIC|VT_INLINE)) | static_proto;
972 sym->type.t = (type->t & ~VT_STATIC) | static_proto;967 sym->type.ref = type->ref;
968 } else {
969 sym->type.t &= ~VT_INLINE | static_proto;
970 }
971
972 if (sym->type.ref->f.func_type == FUNC_OLD
973 && type->ref->f.func_type != FUNC_OLD) {
974 sym->type.ref = type->ref;
973 }975 }
976
974 } else {977 } else {
975 if ((sym->type.t & VT_ARRAY) && type->ref->c >= 0) {978 if ((sym->type.t & VT_ARRAY) && type->ref->c >= 0) {
976 /* set array size if it was omitted in extern declaration */979 /* set array size if it was omitted in extern declaration */
977 if (sym->type.ref->c < 0)980 sym->type.ref->c = type->ref->c;
978 sym->type.ref->c = type->ref->c;
979 else if (sym->type.ref->c != type->ref->c)
980 tcc_error("conflicting type for '%s'", get_tok_str(sym->v, NULL));
981 }981 }
982 if ((type->t ^ sym->type.t) & VT_STATIC)982 if ((type->t ^ sym->type.t) & VT_STATIC)
983 tcc_warning("storage mismatch for redefinition of '%s'",983 tcc_warning("storage mismatch for redefinition of '%s'",
@@ -985,7 +985,6 @@ static void patch_type(Sym *sym, CType *type) · 1 unmodified line
985 }985 }
986}986}
987 987
988
989/* Merge some storage attributes. */988/* Merge some storage attributes. */
990static void patch_storage(Sym *sym, AttributeDef *ad, CType *type)989static void patch_storage(Sym *sym, AttributeDef *ad, CType *type)
991{990{
@@ -1003,29 +1002,55 @@ static void patch_storage(Sym *sym, AttributeDef *ad, CType *type) · 11 unmodified lines
1003 update_storage(sym);1002 update_storage(sym);
1004}1003}
1005 1004
1005/* copy sym to other stack */
1006static Sym *sym_copy(Sym *s0, Sym **ps)
1007{
1008 Sym *s;
1009 s = sym_malloc(), *s = *s0;
1010 s->prev = *ps, *ps = s;
1011 if (s->v < SYM_FIRST_ANOM) {
1012 ps = &table_ident[s->v - TOK_IDENT]->sym_identifier;
1013 s->prev_tok = *ps, *ps = s;
1014 }
1015 return s;
1016}
1017
1018/* copy a list of syms */
1019static void sym_copy_ref(Sym *s0, Sym **ps)
1020{
1021 Sym *s, **sp = &s0->type.ref;
1022 for (s = *sp, *sp = NULL; s; s = s->next)
1023 sp = &(*sp = sym_copy(s, ps))->next;
1024}
1025
1006/* define a new external reference to a symbol 'v' */1026/* define a new external reference to a symbol 'v' */
1007static Sym *external_sym(int v, CType *type, int r, AttributeDef *ad)1027static Sym *external_sym(int v, CType *type, int r, AttributeDef *ad)
1008{1028{
1009 Sym *s;1029 Sym *s; int bt;
1030
1031 /* look for global symbol */
1010 s = sym_find(v);1032 s = sym_find(v);
1011 if (!s || (!IS_ASM_SYM(s) && !(s->type.t & VT_EXTERN)1033 while (s && s->sym_scope)
1012 && (!(type->t & VT_EXTERN) || s->sym_scope)1034 s = s->prev_tok;
1013 && (s->type.t & VT_BTYPE) != VT_FUNC)) {1035
1014 if (s && !is_compatible_types(&s->type, type))1036 if (!s) {
1015 tcc_error("conflicting types for '%s'", get_tok_str(s->v, NULL));
1016 /* push forward reference */1037 /* push forward reference */
1017 s = sym_push(v, type, r | VT_CONST | VT_SYM, 0);1038 s = global_identifier_push(v, type->t, 0);
1039 s->r |= r;
1018 s->a = ad->a;1040 s->a = ad->a;
1019 s->asm_label = ad->asm_label;1041 s->asm_label = ad->asm_label;
1020 s->sym_scope = 0;1042 s->type.ref = type->ref;
1043 bt = s->type.t & (VT_BTYPE|VT_ARRAY);
1044 /* copy type to the global stack also */
1045 if (local_scope && (bt == VT_FUNC || (bt & VT_ARRAY)))
1046 sym_copy_ref(s, &global_stack);
1021 } else {1047 } else {
1022 if (s->type.ref == func_old_type.ref) {
1023 s->type.ref = type->ref;
1024 s->r = r | VT_CONST | VT_SYM;
1025 s->type.t |= VT_EXTERN;
1026 }
1027 patch_storage(s, ad, type);1048 patch_storage(s, ad, type);
1049 bt = s->type.t & VT_BTYPE;
1028 }1050 }
1051 /* push variables to local scope if any */
1052 if (local_stack && bt != VT_FUNC)
1053 s = sym_copy(s, &local_stack);
1029 return s;1054 return s;
1030}1055}
1031 1056
@@ -2880,27 +2905,29 @@ static int is_compatible_func(CType *type1, CType *type2) · 1848 unmodified lines
2880 2905
2881 s1 = type1->ref;2906 s1 = type1->ref;
2882 s2 = type2->ref;2907 s2 = type2->ref;
2883 if (!is_compatible_types(&s1->type, &s2->type))
2884 return 0;
2885 /* check func_call */
2886 if (s1->f.func_call != s2->f.func_call)2908 if (s1->f.func_call != s2->f.func_call)
2887 return 0;2909 return 0;
2888 /* XXX: not complete */2910 if (s1->f.func_type != s2->f.func_type
2889 if (s1->f.func_type == FUNC_OLD || s2->f.func_type == FUNC_OLD)2911 && s1->f.func_type != FUNC_OLD
2890 return 1;2912 && s2->f.func_type != FUNC_OLD)
2891 if (s1->f.func_type != s2->f.func_type)
2892 return 0;2913 return 0;
2893 while (s1 != NULL) {2914 /* we should check the function return type for FUNC_OLD too
2894 if (s2 == NULL)2915 but that causes problems with the internally used support
2895 return 0;2916 functions such as TOK_memmove */
2917 if (s1->f.func_type == FUNC_OLD && !s1->next)
2918 return 1;
2919 if (s2->f.func_type == FUNC_OLD && !s2->next)
2920 return 1;
2921 for (;;) {
2896 if (!is_compatible_unqualified_types(&s1->type, &s2->type))2922 if (!is_compatible_unqualified_types(&s1->type, &s2->type))
2897 return 0;2923 return 0;
2898 s1 = s1->next;2924 s1 = s1->next;
2899 s2 = s2->next;2925 s2 = s2->next;
2926 if (!s1)
2927 return !s2;
2928 if (!s2)
2929 return 0;
2900 }2930 }
2901 if (s2)
2902 return 0;
2903 return 1;
2904}2931}
2905 2932
2906/* return true if type1 and type2 are the same. If unqualified is2933/* return true if type1 and type2 are the same. If unqualified is
@@ -2926,15 +2953,19 @@ static int compare_types(CType *type1, CType *type2, int unqualified) · 19 unmodified lines
2926 /* XXX: bitfields ? */2953 /* XXX: bitfields ? */
2927 if (t1 != t2)2954 if (t1 != t2)
2928 return 0;2955 return 0;
2956
2957 if ((t1 & VT_ARRAY)
2958 && !(type1->ref->c < 0
2959 || type2->ref->c < 0
2960 || type1->ref->c == type2->ref->c))
2961 return 0;
2962
2929 /* test more complicated cases */2963 /* test more complicated cases */
2930 bt1 = t1 & (VT_BTYPE | VT_ARRAY);2964 bt1 = t1 & VT_BTYPE;
2931 if (bt1 == VT_PTR) {2965 if (bt1 == VT_PTR) {
2932 type1 = pointed_type(type1);2966 type1 = pointed_type(type1);
2933 type2 = pointed_type(type2);2967 type2 = pointed_type(type2);
2934 return is_compatible_types(type1, type2);2968 return is_compatible_types(type1, type2);
2935 } else if (bt1 & VT_ARRAY) {
2936 return type1->ref->c < 0 || type2->ref->c < 0
2937 || type1->ref->c == type2->ref->c;
2938 } else if (bt1 == VT_STRUCT) {2969 } else if (bt1 == VT_STRUCT) {
2939 return (type1->ref == type2->ref);2970 return (type1->ref == type2->ref);
2940 } else if (bt1 == VT_FUNC) {2971 } else if (bt1 == VT_FUNC) {
@@ -7285,9 +7316,6 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 4344 unmodified lines
7285 sym = sym_push(v, type, r | VT_SYM, 0);7316 sym = sym_push(v, type, r | VT_SYM, 0);
7286 patch_storage(sym, ad, NULL);7317 patch_storage(sym, ad, NULL);
7287 }7318 }
7288 /* Local statics have a scope until now (for
7289 warnings), remove it here. */
7290 sym->sym_scope = 0;
7291 /* update symbol definition */7319 /* update symbol definition */
7292 put_extern_sym(sym, sec, addr, size);7320 put_extern_sym(sym, sec, addr, size);
7293 } else {7321 } else {
@@ -7431,7 +7459,7 @@ static void gen_inline_functions(TCCState *s) · 137 unmodified lines
7431 for (i = 0; i < s->nb_inline_fns; ++i) {7459 for (i = 0; i < s->nb_inline_fns; ++i) {
7432 fn = s->inline_fns[i];7460 fn = s->inline_fns[i];
7433 sym = fn->sym;7461 sym = fn->sym;
7434 if (sym && (sym->c || !(sym->type.t & (VT_INLINE | VT_STATIC)) )) {7462 if (sym && (sym->c || !(sym->type.t & VT_INLINE))) {
7435 /* the function was used or forced (and then not internal):7463 /* the function was used or forced (and then not internal):
7436 generate its code and convert it to a normal function */7464 generate its code and convert it to a normal function */
7437 fn->sym = NULL;7465 fn->sym = NULL;
@@ -7544,22 +7572,26 @@ static int decl0(int l, int is_for_loop_init, Sym *func_sym) · 106 unmodified lines
7544 }7572 }
7545#endif7573#endif
7546 if ((type.t & VT_BTYPE) == VT_FUNC) {7574 if ((type.t & VT_BTYPE) == VT_FUNC) {
7547 if ((type.t & VT_STATIC) && (l == VT_LOCAL)) {
7548 tcc_error("function without file scope cannot be static");
7549 }
7550 /* if old style function prototype, we accept a7575 /* if old style function prototype, we accept a
7551 declaration list */7576 declaration list */
7552 sym = type.ref;7577 sym = type.ref;
7553 if (sym->f.func_type == FUNC_OLD && l == VT_CONST)7578 if (sym->f.func_type == FUNC_OLD && l == VT_CONST)
7554 decl0(VT_CMP, 0, sym);7579 decl0(VT_CMP, 0, sym);
7580 /* always compile 'extern inline' */
7581 if (type.t & VT_EXTERN)
7582 type.t &= ~VT_INLINE;
7555 }7583 }
7556 7584
7557 if (gnu_ext && (tok == TOK_ASM1 || tok == TOK_ASM2 || tok == TOK_ASM3)) {7585 if (gnu_ext && (tok == TOK_ASM1 || tok == TOK_ASM2 || tok == TOK_ASM3)) {
7558 ad.asm_label = asm_label_instr();7586 ad.asm_label = asm_label_instr();
7559 /* parse one last attribute list, after asm label */7587 /* parse one last attribute list, after asm label */
7560 parse_attribute(&ad);7588 parse_attribute(&ad);
7589 #if 0
7590 /* gcc does not allow __asm__("label") with function definition,
7591 but why not ... */
7561 if (tok == '{')7592 if (tok == '{')
7562 expect(";");7593 expect(";");
7594 #endif
7563 }7595 }
7564 7596
7565#ifdef TCC_TARGET_PE7597#ifdef TCC_TARGET_PE
@@ -7591,18 +7623,12 @@ static int decl0(int l, int is_for_loop_init, Sym *func_sym) · 25 unmodified lines
7591 }7623 }
7592 7624
7593 /* put function symbol */7625 /* put function symbol */
7626 type.t &= ~VT_EXTERN;
7594 sym = external_sym(v, &type, 0, &ad);7627 sym = external_sym(v, &type, 0, &ad);
7595 /* This is the def, so overwrite any other parameter names
7596 we got from prototypes. */
7597 sym->type.ref = type.ref;
7598 if (sym->c && elfsym(sym)->st_shndx != SHN_UNDEF
7599 && !(elfsym(sym)->st_other & ST_ASM_SET))
7600 tcc_error("redefinition of '%s'", get_tok_str(sym->v, NULL));
7601
7602 /* static inline functions are just recorded as a kind7628 /* static inline functions are just recorded as a kind
7603 of macro. Their code will be emitted at the end of7629 of macro. Their code will be emitted at the end of
7604 the compilation unit only if they are used */7630 the compilation unit only if they are used */
7605 if ((sym->type.t & (VT_INLINE | VT_EXTERN)) == VT_INLINE) {7631 if (sym->type.t & VT_INLINE) {
7606 struct InlineFunc *fn;7632 struct InlineFunc *fn;
7607 const char *filename;7633 const char *filename;
7608 7634
@@ -7669,16 +7695,15 @@ found: · 60 unmodified lines
7669 has_init = (tok == '=');7695 has_init = (tok == '=');
7670 if (has_init && (type.t & VT_VLA))7696 if (has_init && (type.t & VT_VLA))
7671 tcc_error("variable length array cannot be initialized");7697 tcc_error("variable length array cannot be initialized");
7672 if (((type.t & VT_EXTERN) && (!has_init || l != VT_CONST)) ||7698 if (((type.t & VT_EXTERN) && (!has_init || l != VT_CONST))
7673 ((type.t & VT_BTYPE) == VT_FUNC) ||7699 || (type.t & VT_BTYPE) == VT_FUNC
7674 ((type.t & VT_ARRAY) && (type.t & VT_STATIC) &&7700 /* as with GCC, uninitialized global arrays with no size
7675 !has_init && l == VT_CONST && type.ref->c < 0)) {7701 are considered extern: */
7702 || ((type.t & VT_ARRAY) && !has_init
7703 && l == VT_CONST && type.ref->c < 0)
7704 ) {
7676 /* external variable or function */7705 /* external variable or function */
7677 /* NOTE: as GCC, uninitialized global static7706 type.t |= VT_EXTERN;
7678 arrays of null size are considered as
7679 extern */
7680 if ((type.t & VT_BTYPE) != VT_FUNC)
7681 type.t |= VT_EXTERN;
7682 sym = external_sym(v, &type, r, &ad);7707 sym = external_sym(v, &type, r, &ad);
7683 if (ad.alias_target) {7708 if (ad.alias_target) {
7684 ElfSym *esym;7709 ElfSym *esym;
@@ -7687,9 +7712,6 @@ found: · 2 unmodified lines
7687 esym = elfsym(alias_target);7712 esym = elfsym(alias_target);
7688 if (!esym)7713 if (!esym)
7689 tcc_error("unsupported forward __alias__ attribute");7714 tcc_error("unsupported forward __alias__ attribute");
7690 /* Local statics have a scope until now (for
7691 warnings), remove it here. */
7692 sym->sym_scope = 0;
7693 put_extern_sym2(sym, esym->st_shndx, esym->st_value, esym->st_size, 0);7715 put_extern_sym2(sym, esym->st_shndx, esym->st_value, esym->st_size, 0);
7694 }7716 }
7695 } else {7717 } else {
@@ -7699,8 +7721,7 @@ found: · 3 unmodified lines
7699 r |= l;7721 r |= l;
7700 if (has_init)7722 if (has_init)
7701 next();7723 next();
7702 else if (l == VT_CONST7724 else if (l == VT_CONST)
7703 && (type.t & VT_BTYPE) != VT_FUNC)
7704 /* uninitialized global variables may be overridden */7725 /* uninitialized global variables may be overridden */
7705 type.t |= VT_EXTERN;7726 type.t |= VT_EXTERN;
7706 decl_initializer_alloc(&type, &ad, r, has_init, v, l);7727 decl_initializer_alloc(&type, &ad, r, has_init, v, l);
tests/tests2/60_errors_and_warnings.c+77−1
@@ -196,6 +196,82 @@ void * _Alignas(16) p1; · 195 unmodified lines
196 const f t[3];196 const f t[3];
197 197
198#elif defined test_incomplete_array_array198#elif defined test_incomplete_array_array
199 int t[][3];199 int t[][3]; // gr: not an error, see below
200
201/******************************************************************/
202#elif defined test_extern_array
203int iii[] = { 1,2,3 };
204extern int iii[];
205int x[];
206int x[2];
207int x[];
208int x[2];
209int x[];
210extern int x[2];
211extern int x[];
212int x[3];
213
214/******************************************************************/
215#elif defined test_func_1 \
216 || defined test_func_2 \
217 || defined test_func_3 \
218 || defined test_func_4 \
219 || defined test_func_5
220#if defined test_func_1
221int hello(int);
222#elif defined test_func_4
223static int hello(int);
224#endif
225int main () {
226#if defined test_func_5
227 static
228#endif
229 int hello(int);
230 hello(123);
231 return 0;
232}
233int printf(const char*, ...);
234#if defined test_func_3
235static int hello(int a)
236#elif defined test_func_5
237int hello(int a, int b)
238#else
239int hello(int a)
240#endif
241{ printf("%s: a = %d\n", __FUNCTION__, a); return 0; }
242
243/******************************************************************/
244#elif defined test_var_1 \
245 || defined test_var_2 \
246 || defined test_var_3
247#define P(n,v) printf("%-5s: %d ; %d\n", __FUNCTION__, n, v)
248#if defined test_var_1
249int xxx[];
250#endif
251int bar();
252int printf(const char*, ...);
253int main ()
254{
255#if !defined test_var_3
256 int xxx = 2;
257#endif
258 {
259 extern int xxx[
260#if defined test_var_3
261 2
262#endif
263 ];
264 P(1, xxx[0]);
265 xxx[0] += 2;
266 }
267#if !defined test_var_3
268 P(2, xxx);
269#endif
270 bar(123);
271 return 0;
272}
273int xxx[1] = {1};
274int bar() { P(3, xxx[0]); return 0; }
200 275
276/******************************************************************/
201#endif277#endif
tests/tests2/60_errors_and_warnings.expect+33−2
@@ -73,7 +73,7 @@ · 72 unmodified lines
7360_errors_and_warnings.c:153: error: ',' expected (got "a")7360_errors_and_warnings.c:153: error: ',' expected (got "a")
74 74
75[test_conflicting_types]75[test_conflicting_types]
7660_errors_and_warnings.c:159: error: conflicting types for 'i'7660_errors_and_warnings.c:159: error: incompatible types for redefinition of 'i'
77 77
78[test_nested_types]78[test_nested_types]
7960_errors_and_warnings.c:166: error: struct/union/enum already defined7960_errors_and_warnings.c:166: error: struct/union/enum already defined
@@ -100,4 +100,35 @@ · 20 unmodified lines
10060_errors_and_warnings.c:196: error: declaration of an array of functions10060_errors_and_warnings.c:196: error: declaration of an array of functions
101 101
102[test_incomplete_array_array]102[test_incomplete_array_array]
10360_errors_and_warnings.c:199: error: unknown type size103
104[test_extern_array]
10560_errors_and_warnings.c:212: error: incompatible types for redefinition of 'x'
106
107[test_func_1]
108hello: a = 123
109
110[test_func_2]
111hello: a = 123
112
113[test_func_3]
11460_errors_and_warnings.c:241: warning: static storage ignored for redefinition of 'hello'
115hello: a = 123
116
117[test_func_4]
118hello: a = 123
119
120[test_func_5]
12160_errors_and_warnings.c:241: error: incompatible types for redefinition of 'hello'
122
123[test_var_1]
124main : 1 ; 1
125main : 2 ; 2
126bar : 3 ; 3
127
128[test_var_2]
129main : 1 ; 1
130main : 2 ; 2
131bar : 3 ; 3
132
133[test_var_3]
13460_errors_and_warnings.c:273: error: incompatible types for redefinition of 'xxx'

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t