diff --git a/Makefile.in b/Makefile.in index bf7bda583..4b268c883 100644 --- a/Makefile.in +++ b/Makefile.in @@ -157,7 +157,8 @@ endif rm -rf autom4te.cache cppcheck: $(O:.o=.cc) $(srcdir)/dosify.c $(srcdir)/version.c - cppcheck --enable=all -f $(INCLUDE_PATH) $^ + cppcheck --enable=all -f --suppressions $(srcdir)/cppcheck.sup \ + $(INCLUDE_PATH) $^ cppcheck-all: $(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) cppcheck && ) true diff --git a/cppcheck.sup b/cppcheck.sup new file mode 100644 index 000000000..76827e0c2 --- /dev/null +++ b/cppcheck.sup @@ -0,0 +1,3 @@ +// These are correct and are used to find the base (zero) pin. +thisSubtraction:netlist.h:4119 +thisSubtraction:netlist.h:4128 diff --git a/vpi/Makefile.in b/vpi/Makefile.in index a9720dbd7..18e06489a 100644 --- a/vpi/Makefile.in +++ b/vpi/Makefile.in @@ -87,7 +87,8 @@ distclean: clean rm -f vpi_config.h stamp-vpi_config-h cppcheck: $(O:.o=.c) $(OPP:.o=.cc) $(M:.o=.c) $(V:.o=.c) - cppcheck --enable=all -f $(INCLUDE_PATH) $^ + cppcheck --enable=all -f --suppressions $(srcdir)/cppcheck.sup \ + $(INCLUDE_PATH) $^ Makefile: $(srcdir)/Makefile.in ../config.status cd ..; ./config.status --file=vpi/$@ diff --git a/vpi/cppcheck.sup b/vpi/cppcheck.sup new file mode 100644 index 000000000..fa763acd9 --- /dev/null +++ b/vpi/cppcheck.sup @@ -0,0 +1,41 @@ +// The following three files are copied directly from GTKWave and we do not +// have control over them. Tony has a specific programming style so these +// problems will not be fixed. + +// fstapi.c from GTKWave +variableScope:fstapi.c:1485 +variableScope:fstapi.c:1602 +variableScope:fstapi.c:1642 +variableScope:fstapi.c:1643 +variableScope:fstapi.c:2336 +variableScope:fstapi.c:2651 +variableScope:fstapi.c:2655 +variableScope:fstapi.c:2656 + +// lxt2_write.c from GTKWave +variableScope:lxt2_write.c:63 +variableScope:lxt2_write.c:523 +variableScope:lxt2_write.c:581 +variableScope:lxt2_write.c:587 +variableScope:lxt2_write.c:1602 +variableScope:lxt2_write.c:2049 + +// lxt_write.c from GTKWave +variableScope:lxt_write.c:31 +variableScope:lxt_write.c:587 +variableScope:lxt_write.c:640 +variableScope:lxt_write.c:1056 +variableScope:lxt_write.c:1057 +variableScope:lxt_write.c:1058 +variableScope:lxt_write.c:1841 +variableScope:lxt_write.c:2586 +variableScope:lxt_write.c:2587 +variableScope:lxt_write.c:2588 +variableScope:lxt_write.c:2589 + +// The routines in sys_random.c are exact copies from IEEE1364-2005 and +// they have scope warnings that we need to ignore. +variableScope:sys_random.c:46 +variableScope:sys_random.c:69 +variableScope:sys_random.c:92 +variableScope:sys_random.c:147