# Machine and environ dependent definitions
EMHOME = ../../..
+EMHOME = /usr/proj/em/Work#???
MKDEP = $(EMHOME)/bin/mkdep
PRID = $(EMHOME)/bin/prid
CID = $(EMHOME)/bin/cid
.str.h:
./make.allocd <$*.str >$*.h
+LINTTEST: #???
+ make Lnt
+# ../lpass2/lint -Dunix -DMINIX /usr/star/ast/minix/tape3/commands/make/*.c
+ ./lnt -h -Dlint --x s.c #x46.c #ceriel.c #m.c #lithm.c # fig4.c
+# (cd ../lpass2; make lint.test)
+# ./lnt -Dmc68000 -I/usr/em/h -I/usr/em/modules/h -I/usr/em/modules/pkg u.c
+
Main: Cfiles
sh -c 'if $(CC) nmclash.c > /dev/null 2>&1 ; then make "EMHOME="$(EMHOME) $(CURRDIR)main ; else EMHOME=$(EMHOME); export EMHOME; ./Resolve main ; fi'
@rm -f nmclash.o a.out
Lnt: Cfiles
sh -c 'if $(CC) nmclash.c > /dev/null 2>&1 ; then make "EMHOME="$(EMHOME) $(CURRDIR)lnt ; else EMHOME=$(EMHOME); export EMHOME; ./Resolve lnt ; fi'
- make "EMHOME="$(EMHOME) $(CURRDIR)lnt
@rm -f nmclash.o a.out
install: Main
/*
*The following functions are hacked to null-functions (i.e. they
- * do nothing). This needs another solution in the future.
+ * do nothing). This needs another solution in the future. !!???!!
*/
#include "lint.h"
/* ARGSUSED */
CC_crdnam(ps_xxx,v,s) char *v; arith s; {}
/* ARGSUSED */
-CC_crfcon(ps_xxx,v,s) char *v; arith s; {}
-/* ARGSUSED */
-CC_cricon(ps_xxx,v,s) char *v; arith s; {}
+CC_crxcon(op,ps_xxx,v,s) char *v; arith s; {}
/* ARGSUSED */
CC_crilb(ps_xxx,v) label v; {}
/* ARGSUSED */
/* ARGSUSED */
CC_crscon(ps_xxx,v,s) char *v; arith s; {}
/* ARGSUSED */
-CC_crucon(ps_xxx,v,s) char *v; arith s; {}
-/* ARGSUSED */
CC_cst(l) {}
/* ARGSUSED */
CC_dfdlb(l) label l; {}
if ( (sc == STATIC || sc == LABEL)
&& !def->df_used
+ && !is_anon_idf(idf)
) {
def_warning(def, "%s %s not used anywhere in function %s",
symbol2str(sc), idf->id_text, func_name);
&& !def->df_initialized
&& def->df_firstbrace != 0
&& def->df_minlevel != level
+ && !is_anon_idf(idf)
) {
register int diff = def->df_minlevel - level;
if (sc == STATIC && !def->df_used) {
if (def->df_set) {
- def_warning(def,
- "%s %s %s set but not used",
- symbol2str(sc),
- symbol2str(fund),
- idf->id_text);
+ if (!is_anon_idf(idf) && fund != ERRONEOUS) {
+ def_warning(def,
+ "%s %s %s set but not used",
+ symbol2str(sc),
+ symbol2str(fund),
+ idf->id_text);
+ }
}
else {
- def_warning(def,
- "%s %s %s not used anywhere",
- symbol2str(sc),
- symbol2str(fund),
- idf->id_text);
+ if (!is_anon_idf(idf) && fund != ERRONEOUS) {
+ def_warning(def,
+ "%s %s %s not used anywhere",
+ symbol2str(sc),
+ symbol2str(fund),
+ idf->id_text);
+ }
}
}
if (loptions['x']) {
&& !def->df_initialized
&& !def->df_used
&& strcmp(&fn[strlen(fn)-2], ".c") == 0
+ && !is_anon_idf(idf)
+ && fund != ERRONEOUS
) {
def_warning(def,
"%s %s %s not used anywhere",
break;
case USED:
if (!a->ad_set) {
- warning("%s%s uninitialized", idf->id_text,
- (a->ad_maybe_set ? " possibly" : "")
- );
+ if (!is_anon_idf(idf)) {
+ warning("%s%s uninitialized", idf->id_text,
+ (a->ad_maybe_set ? " possibly" : "")
+ );
+ }
a->ad_maybe_set = 0;
a->ad_set = 1; /* one warning */
}
ASSERT(!(a && a->ad_def->df_level > level));
while (a && a->ad_def->df_level == level) {
- if (!a->ad_used) {
+ if (!a->ad_used && !is_anon_idf(a->ad_idf)) {
if (a->ad_set || a->ad_maybe_set) {
def_warning(a->ad_def,
"%s set but not used in function %s",
if ( (def && !def->df_used)
&& !(f_ARGSUSED || LINTLIB)
+ && !is_anon_idf(se->se_idf)
) {
def_warning(def, "argument %s not used in function %s",
se->se_idf->id_text, func_name);
/******** A C T I O N S : S W I T C H ********/
-start_switch_part(expr)
- struct expr *expr;
+start_switch_part(const)
{
/* ls_current of a SWITCH entry has different meaning from ls_current of
* other entries. It keeps track of which variables are used in all
register struct lint_stack_entry *new = mk_lint_stack_entry(SWITCH);
dbg_lint_stack("start_switch_part");
- if (is_cp_cst(expr))
+ if (const)
hwarning("value in switch statement is constant");
new->LS_CASE = copy_state(top_ls->ls_current, level);
top_ls->ls_current->st_notreached = 1;
top_ls->ls_current->st_warned = 0;
lint_push(new);
- lint_expr(expr, USED); /*???*/
}
end_switch_stmt()
if ( e == NOVALRETURNED
&& !func_notypegiven
&& fund != VOID
+ && fund != ERRONEOUS
) {
warning("function %s declared %s%s but no value returned",
func_name,