We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion by @shishirb-MSFT:
We can add a "(void)(0 && printf(format, VA_ARGS))" as the first line of the logging macros.
The expression is short-circuited by '0 &&' such that no runtime call is made. It will also do a compile-time check of the arguments.
The text was updated successfully, but these errors were encountered:
Did some testing:
LOG_INFO(handler, "%d", string_arg);
I got
warning C4477: 'printf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'const char *'
For
LOG_INFO(handler, "%s %d", string_arg);
warning C4473: 'printf' : not enough arguments passed for format string
Sorry, something went wrong.
No branches or pull requests
Suggestion by @shishirb-MSFT:
We can add a "(void)(0 && printf(format, VA_ARGS))" as the first line of the logging macros.
The expression is short-circuited by '0 &&' such that no runtime call is made.
It will also do a compile-time check of the arguments.
The text was updated successfully, but these errors were encountered: