break;
case EQUAL:
case NOTEQUAL:
+ case ':':
case '=':
case RETURN:
if (is_cp_cst(*expp) && (*expp)->VL_VALUE == (arith)0)
break;
default:
expr_warning(*expp,
- "illegal conversion of %s to pointer",
+ "dubious conversion of %s to pointer",
symbol2str(oldtp->tp_fund));
break;
}
lint_ext_def(idf, sc)
struct idf *idf;
{
-/* At this place the following fields of the outputdefinition can be
+/* At this place the following fields of the output definition can be
* filled:
* name, stat_number, class, file, line, type.
* For variable definitions and declarations this will be all.
switch (type->tp_fund) {
case CHAR:
case SHORT:
- type = int_type;
+ type = (type->tp_unsigned ? uint_type : int_type);
break;
case FLOAT:
type = double_type;
/* As the types are output the tp_entries are removed, because they
* are then not needed anymore.
*/
- if (od->od_class == XXDF)
+ if (od->od_class == XXDF || !od->od_name || od->od_name[0] == '#')
return;
if (LINTLIB) {
if ( (sc == STATIC || sc == LABEL)
&& !def->df_used
) {
- def_warning(def, "%s %s declared but not used in function %s",
+ def_warning(def, "%s %s not used anywhere in function %s",
symbol2str(sc), idf->id_text, func_name);
}
}
else {
def_warning(a->ad_def,
- "%s neither set nor used in function %s",
+ "%s not used anywhere in function %s",
a->ad_idf->id_text, func_name);
}
}
dbg_lint_stack("start_loop_stmt");
if (const && !cond) {
/* while (0) | for (;0;) */
- hwarning("condition in %s statement is constant",
+ hwarning("condition in %s statement is always false",
symbol2str(looptype));
new->ls_current->st_notreached = 1;
}
register struct lint_stack_entry *lse = find_wdf();
dbg_lint_stack("end_do_stmt");
+ if (const && !cond) {
+ /* do ... while (0) */
+ hwarning("condition in do statement is always false");
+ }
lse->LS_TEST = (!const ? TEST_VAR : cond ? TEST_TRUE : TEST_FALSE);
end_loop_stmt();