Compile error in VhpiCbHdl.cpp: expected ‘)’ before ‘PRIu32’
See original GitHub issueI’m getting the following error:
In file included from cocotb/share/include/gpi.h:60,
from cocotb/share/lib/vhpi/../gpi/gpi_priv.h:32,
from cocotb/share/lib/vhpi/VhpiImpl.h:31,
from cocotb/share/lib/vhpi/VhpiCbHdl.cpp:29:
cocotb/share/lib/vhpi/VhpiCbHdl.cpp: In member function ‘virtual GpiIterator::Status VhpiIterator::next_handle(std::string&, GpiObjHdl**, void**)’:
cocotb/share/lib/vhpi/VhpiCbHdl.cpp:1150:69: error: expected ‘)’ before ‘PRIu32’
1150 | LOG_DEBUG("Unable to get the name for this object of type " PRIu32, type);
| ^~~~~~
cocotb/share/include/gpi_logging.h:52:98: note: in definition of macro ‘LOG_DEBUG’
52 | #define LOG_DEBUG(...) gpi_log("cocotb.gpi", GPIDebug, __FILE__, __func__, __LINE__, __VA_ARGS__);
| ^~~~~~~~~~~
cocotb/share/include/gpi_logging.h:52:35: note: to match this ‘(’
52 | #define LOG_DEBUG(...) gpi_log("cocotb.gpi", GPIDebug, __FILE__, __func__, __LINE__, __VA_ARGS__);
| ^
cocotb/share/lib/vhpi/VhpiCbHdl.cpp:1150:9: note: in expansion of macro ‘LOG_DEBUG’
1150 | LOG_DEBUG("Unable to get the name for this object of type " PRIu32, type);
| ^~~~~~~~~
error: command 'gcc' failed with exit status 1
This came in via #1361 (https://github.com/cocotb/cocotb/pull/1361/files#diff-8baf84ef545a81134ec388a5b271c5b6R1131).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:21 (18 by maintainers)
Top Results From Across the Web
Why doesn't PRIu64 work in this code? - c++ - Stack Overflow
h , the compiler doesn't include it again, and doesn't see the declaration of __STDC_FORMAT_MACROS . The solution is either to edit Utils.h...
Read more >error: expected ')' before 'PRIu64' - C Board
error : expected ')' before 'PRIu64'. I'm trying to compile the below code just to see the numeric size of an unsigned 64...
Read more >error: expected ')' before '*' token
I have source file parser.c, which compiled fine. However, I need to call some functions in general.c from parser.c, so I added #include...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If I include
<cinttypes>
before"inttypes.h"
in https://github.com/cocotb/cocotb/blob/master/cocotb/share/include/vpi_user.h#L40, then it works.My
inttypes.h
has the definition ofPRIu32
et al. wrapped as follows:Thanks for the confirmation. It will make its way into cocotb, we just haven’t decided on the method to use yet.