From: Peter Krempa <[email protected]>

Since VIR_WARN doesn't use translatable messages, the
'sc_prohibit_error_message_on_multiple_lines' check doesn't catch those.

Introduce another check for VIR_WARN.

Signed-off-by: Peter Krempa <[email protected]>
---
 build-aux/syntax-check.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index 022e8e6550..6e22212944 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -478,6 +478,14 @@ sc_prohibit_error_message_on_multiple_lines:
        halt='found error message on multiple lines' \
        $(_sc_search_regexp)

+# Disallow VIR_WARN and other messagess on multiple lines, except when
+# they end with '\n'.
+sc_prohibit_warnings_on_multiple_lines:
+       @prohibit='VIR_WARN\("[^"]*"$$' \
+    exclude='\\n"$$' \
+       halt='found error message on multiple lines' \
+       $(_sc_search_regexp)
+
 # Look for diagnostics that lack a % in the format string, except that we
 # allow VIR_ERROR to do this, and ignore functions that take a single
 # string rather than a format argument.
-- 
2.54.0

Reply via email to