diff --git a/include/verilated.h b/include/verilated.h index c49226ce4..c2bc2bfad 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -46,6 +46,7 @@ // Allow user to specify their own include file #ifdef VL_VERILATED_INCLUDE +// cppcheck-suppress preprocessorErrorDirective # include VL_VERILATED_INCLUDE #endif // clang-format on diff --git a/test_regress/t/t_dpi_arg_output_type.cpp b/test_regress/t/t_dpi_arg_output_type.cpp index 931f3775a..c257f53ff 100644 --- a/test_regress/t/t_dpi_arg_output_type.cpp +++ b/test_regress/t/t_dpi_arg_output_type.cpp @@ -131,13 +131,13 @@ void i_shortreal(float* o) { void i_chandle(void** o) { static int n = 0; printf("i_chandle %d\n", n); - *o = n++ % 2 ? reinterpret_cast(&i_chandle) : NULL; + *o = (n++ % 2) ? reinterpret_cast(&i_chandle) : NULL; } void i_string(const char** o) { static int n = 0; printf("i_string %d\n", n); - *o = n++ % 2 ? "Hello" : "World"; + *o = (n++ % 2) ? "Hello" : "World"; } void i_bit(svBit* o) { @@ -247,13 +247,13 @@ void i_shortreal_t(float* o) { void i_chandle_t(void** o) { static int n = 0; printf("i_chandle_t %d\n", n); - *o = n++ % 2 ? reinterpret_cast(&i_chandle) : NULL; + *o = (n++ % 2) ? reinterpret_cast(&i_chandle) : NULL; } void i_string_t(const char** o) { static int n = 0; printf("i_string_t %d\n", n); - *o = n++ % 2 ? "Hello" : "World"; + *o = (n++ % 2) ? "Hello" : "World"; } void i_bit_t(svBit* o) {