From: dick Date: Mon, 7 Jan 1991 12:33:38 +0000 (+0000) Subject: more additions for lint X-Git-Tag: release-5-5~1306 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=4a7ef15df2b8a539f29861dab36b138ef3d5df84;p=ack.git more additions for lint --- diff --git a/lang/cem/cemcom.ansi/arith.c b/lang/cem/cemcom.ansi/arith.c index b327630a8..a733d87a8 100644 --- a/lang/cem/cemcom.ansi/arith.c +++ b/lang/cem/cemcom.ansi/arith.c @@ -254,6 +254,9 @@ any2arith(expp, oper) break; case ENUM: #ifndef LINT + /* we do not want this conversion for lint, since we + want to keep enums and ints separate + */ int2int(expp, int_type); #endif LINT break; diff --git a/lang/cem/cemcom.ansi/code.c b/lang/cem/cemcom.ansi/code.c index b8724ea73..c9b111e33 100644 --- a/lang/cem/cemcom.ansi/code.c +++ b/lang/cem/cemcom.ansi/code.c @@ -342,7 +342,6 @@ end_proc(fbytes) } C_df_ilb(return_label); prc_exit(); -#ifndef LINT if (return_expr_occurred) { if (func_res_label != 0) { C_lae_dlb(func_res_label, (arith)0); @@ -352,7 +351,6 @@ end_proc(fbytes) C_ret(func_size); } else C_ret((arith) 0); -#endif LINT /* getting the number of "local" bytes is posponed until here, because copying the function result in "func_res_label" may diff --git a/lang/cem/cemcom.ansi/error.c b/lang/cem/cemcom.ansi/error.c index 619989130..d4280eb22 100644 --- a/lang/cem/cemcom.ansi/error.c +++ b/lang/cem/cemcom.ansi/error.c @@ -146,8 +146,6 @@ debug(va_alist) va_start(ap); { _error(DO_DEBUG, dot.tk_file, dot.tk_line, ap); - /* _error(DO_DEBUG, NILEXPR, ap); - */ } va_end(ap); } @@ -162,8 +160,6 @@ warning(va_alist) va_start(ap); { _error(WARNING, dot.tk_file, dot.tk_line, ap); - /* _error(WARNING, NILEXPR, ap); - */ } va_end(ap); } diff --git a/lang/cem/cemcom.ansi/idf.c b/lang/cem/cemcom.ansi/idf.c index 1e0639ce5..2e0923640 100644 --- a/lang/cem/cemcom.ansi/idf.c +++ b/lang/cem/cemcom.ansi/idf.c @@ -35,6 +35,7 @@ int idfsize = IDFSIZE; extern char options[]; extern arith NewLocal(); extern char *symbol2str(); +extern char *sprint(); char sp_occurred[SP_TOTAL+1]; /* indicate occurrence of special id */ diff --git a/lang/cem/cemcom.ansi/init.c b/lang/cem/cemcom.ansi/init.c index 96bb98118..1d4e663e3 100644 --- a/lang/cem/cemcom.ansi/init.c +++ b/lang/cem/cemcom.ansi/init.c @@ -15,6 +15,8 @@ #include "macro.h" #include "idf.h" +extern char *sprint(); + struct mkey { char *mk_reserved; int mk_key; diff --git a/lang/cem/cemcom.ansi/l_em.h b/lang/cem/cemcom.ansi/l_em.h index f59e21876..02e7a3490 100644 --- a/lang/cem/cemcom.ansi/l_em.h +++ b/lang/cem/cemcom.ansi/l_em.h @@ -28,6 +28,7 @@ #define C_lin(c) #define C_loi(c) #define C_lol(c) +#define C_ret(c) #define C_sdl(c) #define C_sti(c) #define C_stl(c) @@ -72,4 +73,5 @@ #define C_ms_gto() #define C_ms_par(b) #define C_ms_reg(o,s,t,c) +#define C_ms_err() diff --git a/lang/cem/cemcom.ansi/proto.c b/lang/cem/cemcom.ansi/proto.c index 6e20b6455..af1f04cc0 100644 --- a/lang/cem/cemcom.ansi/proto.c +++ b/lang/cem/cemcom.ansi/proto.c @@ -56,10 +56,10 @@ add_proto(pl, ds, dc, lvl) int lvl; { /* The full typed identifier or abstract type, described - by the structures decspecs and declarator are turned + by the structures decspecs and declarator is turned a into parameter type list structure. The parameters will be declared at level L_FORMAL2, - later on it's decided whether they were prototypes + later on it will decided whether they were prototypes or actual declarations. */ register struct idf *idf = dc->dc_idf; @@ -132,7 +132,7 @@ add_proto(pl, ds, dc, lvl) newdef->df_file = idf->id_file; newdef->df_line = idf->id_line; #ifdef LINT - newdef->df_set = (type->tp_fund == ARRAY); + newdef->df_set = 0; /* newdef->df_firstbrace = 0; */ #endif /* We can't put the idf onto the stack, since these kinds @@ -168,8 +168,8 @@ add_proto(pl, ds, dc, lvl) struct tag * gettag(tp, idpp) -struct type *tp; -struct idf **idpp; + struct type *tp; + struct idf **idpp; { struct tag *tg = (struct tag *)0; register int fund = tp->tp_fund; @@ -242,6 +242,11 @@ declare_protos(dc) continue; } + /* Postponed storage class checking. + */ + if (def->df_sc == 0) + error("illegal storage class in parameter declaration"); + def->df_level = L_FORMAL2; stack_idf(pl->pl_idf, stl); pl = pl->next; @@ -312,7 +317,7 @@ update_proto(tp, otp) * remove them from the symbol-table */ remove_proto_tag(tp) -struct type *tp; + struct type *tp; { register struct idf *ident; register struct tag *tgp, **tgpp; @@ -384,7 +389,7 @@ call_proto(expp) { /* If the function specified by (*expp)->OP_LEFT has a prototype, the parameters are converted according the rules specified in - par. 3.3.2.2. E.i. the parameters are converted to the prototype + par. 3.3.2.2. I.e., the parameters are converted to the prototype counter parts as if by assignment. For the parameters falling under ellipsis clause the old parameters conversion stuff applies.