From 4a1697a1b52147ae3d894385e3643e478825ec1c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 8 Apr 2009 21:47:48 -0400 Subject: [PATCH] Fix GCC format warning --- src/Makefile_obj.in | 2 ++ src/V3EmitC.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Makefile_obj.in b/src/Makefile_obj.in index 64d454d32..94c346776 100644 --- a/src/Makefile_obj.in +++ b/src/Makefile_obj.in @@ -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 diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 013a2bc28..c96869302 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -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"); }