void *memcpy(void*, const void*, unsigned); This gave an error if memcpy() has been used before implicitely, e.g. for structure passing etc.
Unified · Split
| @@ -115,10 +115,13 @@ static Sym *external_sym(int v, CType *type, int r) · 114 unmodified lines | ||
| 115 | 115 | /* push forward reference */ |
| 116 | 116 | s = sym_push(v, type, r | VT_CONST | VT_SYM, 0); |
| 117 | 117 | s->type.t |= VT_EXTERN; |
| 118 | − } else { | |
| 119 | − if (!is_compatible_types(&s->type, type)) | |
| 120 | − error("incompatible types for redefinition of '%s'", | |
| 121 | − get_tok_str(v, NULL)); | |
| 118 | + } else if (s->type.ref == func_old_type.ref) { | |
| 119 | + s->type.ref = type->ref; | |
| 120 | + s->r = r | VT_CONST | VT_SYM; | |
| 121 | + s->type.t |= VT_EXTERN; | |
| 122 | + } else if (!is_compatible_types(&s->type, type)) { | |
| 123 | + error("incompatible types for redefinition of '%s'", | |
| 124 | + get_tok_str(v, NULL)); | |
| 122 | 125 | } |
| 123 | 126 | return s; |
| 124 | 127 | } |