diff --git a/vpi/Makefile.in b/vpi/Makefile.in index ea04009b5..82b0a9094 100644 --- a/vpi/Makefile.in +++ b/vpi/Makefile.in @@ -94,8 +94,13 @@ distclean: clean rm -f Makefile config.log rm -f vpi_config.h stamp-vpi_config-h +# The -U flag is used to skip checking paths that depend on that define having +# an explict value (i.e. the define is expected to be real code). cppcheck: $(O:.o=.c) $(OPP:.o=.cc) $(M:.o=.c) $(V:.o=.c) cppcheck --enable=all -f --suppressions-list=$(srcdir)/cppcheck.sup \ + -UYY_USER_INIT \ + -UYYPARSE_PARAM -UYYPRINT -Ushort -Uyyoverflow \ + -UYYTYPE_INT8 -UYYTYPE_INT16 -UYYTYPE_UINT8 -UYYTYPE_UINT16 \ --relative-paths=$(srcdir) $(INCLUDE_PATH) $^ Makefile: $(srcdir)/Makefile.in ../config.status diff --git a/vpi/lxt2_write.c b/vpi/lxt2_write.c index 38b11f602..c1fed8a43 100644 --- a/vpi/lxt2_write.c +++ b/vpi/lxt2_write.c @@ -578,13 +578,13 @@ return; static void lxt2_wr_emitfacs(struct lxt2_wr_trace *lt) { -int i; +unsigned int i; if((lt)&&(lt->numfacs)) { struct lxt2_wr_symbol *s = lt->symchain; struct lxt2_wr_symbol **aliascache = calloc(lt->numalias ? lt->numalias : 1, sizeof(struct lxt2_wr_symbol *)); - int aliases_encountered, facs_encountered; + unsigned int aliases_encountered, facs_encountered; lt->sorted_facs = (struct lxt2_wr_symbol **)calloc(lt->numfacs, sizeof(struct lxt2_wr_symbol *)); @@ -1369,7 +1369,7 @@ if((lt->timegranule>=lt->maxgranule)||(do_finalize)||(early_flush)) for(i=0;inum_map_entries;i++) { /* fprintf(stderr, "+++ %08x (%d)(%d)\n", dt->item, i, dt->val); */ - if(dt->val != i) + if(((unsigned int)dt->val) != i) { fprintf(stderr, "internal error line %d\n", __LINE__); exit(255); diff --git a/vpi/lxt2_write.h b/vpi/lxt2_write.h index 8c9a47b68..7f2c6d134 100644 --- a/vpi/lxt2_write.h +++ b/vpi/lxt2_write.h @@ -163,7 +163,7 @@ off_t current_chunk, current_chunkz; struct lxt2_wr_symbol *sym[LXT2_WR_SYMPRIME]; struct lxt2_wr_symbol **sorted_facs; struct lxt2_wr_symbol *symchain; -int numfacs, numalias; +unsigned int numfacs, numalias; int numfacbytes; int longestname; @@ -174,7 +174,7 @@ lxttime_t mintime, maxtime; lxtstime_t timezero; unsigned int timegranule; int timescale; -int timepos; +unsigned int timepos; unsigned int maxgranule; lxttime_t firsttime, lasttime; lxttime_t timetable[LXT2_WR_GRANULE_SIZE];