fixed bug with double definition
This commit is contained in:
parent
51467658c6
commit
a1e2a583b5
1 changed files with 3 additions and 2 deletions
|
@ -415,9 +415,10 @@ global_redecl(idf, new_sc, tp)
|
||||||
*/
|
*/
|
||||||
register struct def *def = idf->id_def;
|
register struct def *def = idf->id_def;
|
||||||
|
|
||||||
if (!equal_type(tp, def->df_type, 0))
|
if (!equal_type(tp, def->df_type, 0)) {
|
||||||
error("redeclaration of %s with different type", idf->id_text);
|
error("redeclaration of %s with different type", idf->id_text);
|
||||||
else update_proto(tp, def->df_type);
|
return;
|
||||||
|
} else update_proto(tp, def->df_type);
|
||||||
if (tp->tp_fund == ARRAY) {
|
if (tp->tp_fund == ARRAY) {
|
||||||
/* Multiple array declaration; this may be interesting */
|
/* Multiple array declaration; this may be interesting */
|
||||||
if (tp->tp_size < 0) { /* new decl has [] */
|
if (tp->tp_size < 0) { /* new decl has [] */
|
||||||
|
|
Loading…
Reference in a new issue