Update some cppcheck suppressions and fix one problem in the code.

Update the line number for a couple cppcheck suppressions and add one for
the pool variable in the vvp directory.

Also move a check for null to the correct place.
This commit is contained in:
Cary R 2011-09-26 12:04:28 -07:00 committed by Stephen Williams
parent c59d27e19f
commit be1be31deb
4 changed files with 12 additions and 8 deletions

View File

@ -1,3 +1,3 @@
// These are correct and are used to find the base (zero) pin. // These are correct and are used to find the base (zero) pin.
thisSubtraction:netlist.h:4152 thisSubtraction:netlist.h:4164
thisSubtraction:netlist.h:4161 thisSubtraction:netlist.h:4173

View File

@ -116,6 +116,11 @@ NetAssign_* PEConcat::elaborate_lval(Design*des,
NetAssign_*tmp = parms_[idx]->elaborate_lval(des, scope, is_force); NetAssign_*tmp = parms_[idx]->elaborate_lval(des, scope, is_force);
/* If the l-value doesn't elaborate, the error was
already detected and printed. We just skip it and let
the compiler catch more errors. */
if (tmp == 0) continue;
if (tmp->expr_type() == IVL_VT_REAL) { if (tmp->expr_type() == IVL_VT_REAL) {
cerr << parms_[idx]->get_fileline() << ": error: " cerr << parms_[idx]->get_fileline() << ": error: "
<< "concatenation operand can not be real: " << "concatenation operand can not be real: "
@ -124,11 +129,6 @@ NetAssign_* PEConcat::elaborate_lval(Design*des,
continue; continue;
} }
/* If the l-value doesn't elaborate, the error was
already detected and printed. We just skip it and let
the compiler catch more errors. */
if (tmp == 0) continue;
/* Link the new l-value to the previous one. */ /* Link the new l-value to the previous one. */
NetAssign_*last = tmp; NetAssign_*last = tmp;
while (last->more) while (last->more)

View File

@ -99,7 +99,8 @@ distclean: clean
rm -f stamp-config-h config.h rm -f stamp-config-h config.h
cppcheck: $(O:.o=.cc) libvpi.c draw_tt.c cppcheck: $(O:.o=.cc) libvpi.c draw_tt.c
cppcheck --enable=all -f $(INCLUDE_PATH) $^ cppcheck --enable=all -f --suppressions $(srcdir)/cppcheck.sup \
$(INCLUDE_PATH) $^
Makefile: $(srcdir)/Makefile.in Makefile: $(srcdir)/Makefile.in
cd ..; ./config.status --file=vvp/$@ cd ..; ./config.status --file=vvp/$@

3
vvp/cppcheck.sup Normal file
View File

@ -0,0 +1,3 @@
// The new() operator is always used to allocate space for this class and
// pool is defined there.
uninitVar:vvp_net.cc:153