]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Do LOG_MESSAGE_VERIFICATION in coverity runs
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 May 2022 12:12:57 +0000 (14:12 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 11 May 2022 14:47:40 +0000 (16:47 +0200)
This should be enough to get reports if we screw up anywhere, coverity does
analysis of printf format strings.

src/basic/log.h

index b03ca3ef21c736eacbf4f7617a87e85170baf75a..7b89c4df6348786949eb2ede443c377b409fe361 100644 (file)
@@ -300,7 +300,7 @@ bool log_on_console(void) _pure_;
 
 /* 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
+#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__