Fix GCC format warning

This commit is contained in:
Wilson Snyder 2009-04-08 21:47:48 -04:00
parent 86f08a341c
commit 4a1697a1b5
2 changed files with 6 additions and 3 deletions

View File

@ -269,12 +269,14 @@ y.tab.c: verilog.y $(HEADERS) bisonpre
$(PERL) $(BISONPRE) --yacc ${YACC} -d -v -o y.tab.c $<
V3Lexer_pregen.yy.cpp: verilog.l y.tab.h $(HEADERS)
${LEX} --version
${LEX} ${LFLAGS} -o$@ $<
V3Lexer.yy.cpp: V3Lexer_pregen.yy.cpp
$(PERL) $(srcdir)/flexfix <$< >$@
V3PreLex_pregen.yy.cpp: V3PreLex.l $(HEADERS)
${LEX} --version
${LEX} ${LFLAGS} -o$@ $<
V3PreLex.yy.cpp: V3PreLex_pregen.yy.cpp

View File

@ -477,9 +477,10 @@ public:
assigntop->iterateAndNext(*this);
}
for (int word=VL_WORDS_I(nodep->num().minWidth())-1; word>0; word--) {
ofp()->printf(",0x%08x", nodep->num().dataWord(word));
// Only 32 bits - llx + long long here just to appease CPP format warning
ofp()->printf(",0x%08llx", (long long)(nodep->num().dataWord(word)));
}
ofp()->printf(",0x%08x)", nodep->num().dataWord(0));
ofp()->printf(",0x%08llx)", (long long)(nodep->num().dataWord(0)));
} else if (nodep->isQuad()) {
vluint64_t num = nodep->toUQuad();
if (num<10) ofp()->printf("VL_ULL(%lld)", (long long)num);
@ -487,7 +488,7 @@ public:
} else {
uint32_t num = nodep->toUInt();
if (num<10) puts(cvtToStr(num));
else ofp()->printf("0x%x", num);
else ofp()->printf("0x%llx", (long long)num);
//Unneeded-Causes %lx format warnings:
// if (!nodep->num().isSigned() && (num & (1UL<<31))) puts("U");
}