added warning about old-fashioned declarations

cleaned up error reporting
changed implicit declaration handling
This commit is contained in:
eck
1990-11-02 09:23:27 +00:00
parent 7de2babe56
commit d7c15759ee
12 changed files with 40 additions and 85 deletions

View File

@@ -186,7 +186,6 @@ code_scope(text, def)
switch (def->df_sc) {
case EXTERN:
case GLOBAL:
case IMPLICIT:
if (fund == FUNCTION)
C_exp(text);
else
@@ -455,8 +454,7 @@ code_declaration(idf, expr, lvl, sc)
)
def->df_alloc = ALLOC_SEEN;
if (expr && def_sc == STATIC && sc == EXTERN) {
warning("%s redeclared extern", idf->id_text);
def->df_sc = EXTERN;
warning("%s has internal linkage", idf->id_text);
}
if (expr) { /* code only if initialized */
#ifndef PREPEND_SCOPES
@@ -468,7 +466,7 @@ code_declaration(idf, expr, lvl, sc)
}
else
if (lvl >= L_LOCAL) { /* local variable */
/* STATIC, EXTERN, GLOBAL, IMPLICIT, AUTO or REGISTER */
/* STATIC, EXTERN, GLOBAL, AUTO or REGISTER */
switch (def_sc) {
case STATIC:
if (fund == FUNCTION) {
@@ -499,7 +497,6 @@ code_declaration(idf, expr, lvl, sc)
error("cannot initialize extern in block"
, idf->id_text);
case GLOBAL:
case IMPLICIT:
/* we are sure there is no expression */
break;
case AUTO: