conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer',
description : 'tailor build to development or release builds')
-conf.set10('LOG_MESSAGE_VERIFICATION', get_option('log-message-verification'))
+verification = get_option('log-message-verification')
+if verification == 'auto'
+ verification = conf.get('BUILD_MODE_DEVELOPER') == 1
+else
+ verification = verification == 'true'
+endif
+conf.set10('LOG_MESSAGE_VERIFICATION', verification)
want_ossfuzz = get_option('oss-fuzz')
want_libfuzzer = get_option('llvm-fuzz')
description : 'run the fuzzer regression tests by default (with sanitizers)')
option('install-tests', type : 'boolean', value : 'false',
description : 'install test executables')
-option('log-message-verification', type : 'boolean', value : 'false',
+option('log-message-verification', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'do fake printf() calls to verify format strings')
option('ok-color', type : 'combo',
* use here. */
static char *log_abort_msg = NULL;
+#if LOG_MESSAGE_VERIFICATION || defined(__COVERITY__)
+bool _log_message_dummy = false; /* Always false */
+#endif
+
/* An assert to use in logging functions that does not call recursively
* into our logging functions (since that might lead to a loop). */
#define assert_raw(expr) \
/* Helper to wrap the main message in structured logging. The macro doesn't do much,
* except to provide visual grouping of the format string and its arguments. */
#if LOG_MESSAGE_VERIFICATION || defined(__COVERITY__)
-/* Do a fake formatting of the message string to let the scanner verify the arguments
- * against the format message. */
-# define LOG_MESSAGE(fmt, ...) "MESSAGE=%.0d" fmt, printf(fmt, ##__VA_ARGS__), ##__VA_ARGS__
+/* Do a fake formatting of the message string to let the scanner verify the arguments against the format
+ * message. The variable will never be set to true, but we don't tell the compiler that :) */
+extern bool _log_message_dummy;
+# define LOG_MESSAGE(fmt, ...) "MESSAGE=%.0d" fmt, (_log_message_dummy && printf(fmt, ##__VA_ARGS__)), ##__VA_ARGS__
#else
# define LOG_MESSAGE(fmt, ...) "MESSAGE=" fmt, ##__VA_ARGS__
#endif