On 11/13/19 10:33 AM, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
new in v2
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 ff1198ca73..78458dce53 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -469,6 +469,11 @@ sc_prohibit_sprintf:
halt='use g_snprintf, not sprintf' \
$(_sc_search_regexp)
+sc_prohibit_snprintf:
+ @prohibit='\<snprintf\>' \
+ halt='use g_snprintf, not snprintf' \
+ $(_sc_search_regexp)
+
Ah, you added a second rule instead of merging the two checks into one rule.
sc_prohibit_readlink:
@prohibit='\<readlink *\(' \
halt='use virFileResolveLink, not readlink' \
@@ -2264,6 +2269,9 @@ exclude_file_name_regexp--sc_prohibit_setuid = ^src/util/virutil\.c|tools/virt-l
exclude_file_name_regexp--sc_prohibit_sprintf = \
^(build-aux/syntax-check\.mk|docs/hacking\.html\.in|.*\.stp|.*\.pl)$$
+exclude_file_name_regexp--sc_prohibit_snprintf = \
+ ^(build-aux/syntax-check\.mk|docs/hacking\.html\.in|tools/virt-login-shell\.c)$$
+
Still, if we are using g_snprintf for both, a single merged rule might
be easier to use.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list