You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is related to #329: enabling all warning by default. The debug_print macro, when disabled, does not "use" the variables passed to it from a static compiler analysis perspective. This causes spurious warnings about unused variables that are used in a debug configuration.
Modify debug_print to always use its arguments, even when its disabled.
There are two possible solutions:
Re-write the debug_print macro to recursively use the variables doing something like this. While this approach works (void)(a) recursively accessing each variable in the macro will be expensive from a cpp perspective.
#defineuse_it(a) (void)(a);
Use a C++ parameter pack to recursively use the args.
I have an implementation now. I have tested (with multiple compilers and versions) that it does not output any code when optimization is turned on. Take a look:
This is related to #329: enabling all warning by default. The
debug_print
macro, when disabled, does not "use" the variables passed to it from a static compiler analysis perspective. This causes spurious warnings about unused variables that are used in a debug configuration.Modify
debug_print
to always use its arguments, even when its disabled.There are two possible solutions:
debug_print
macro to recursively use the variables doing something like this. While this approach works(void)(a)
recursively accessing each variable in the macro will be expensive from a cpp perspective.@nlslatt @PhilMiller
The text was updated successfully, but these errors were encountered: