syntax-check: check for G_GNUC_UNUSED instead of ATTRIBUTE_UNUSED

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko 2019-10-14 15:02:40 +02:00
parent 059cf394ce
commit 6afbb7cf5c

View File

@ -370,7 +370,7 @@ sc_flags_usage:
| $(GREP) -c '\(long\|unsigned\) flags')" != 4 && \ | $(GREP) -c '\(long\|unsigned\) flags')" != 4 && \
{ echo '$(ME): new API should use "unsigned int flags"' 1>&2; \ { echo '$(ME): new API should use "unsigned int flags"' 1>&2; \
exit 1; } || : exit 1; } || :
@prohibit=' flags ATTRIBUTE_UNUSED' \ @prohibit=' flags G_GNUC_UNUSED' \
exclude='virSecurityDomainImageLabelFlags' \ exclude='virSecurityDomainImageLabelFlags' \
halt='flags should be checked with virCheckFlags' \ halt='flags should be checked with virCheckFlags' \
$(_sc_search_regexp) $(_sc_search_regexp)
@ -620,12 +620,12 @@ sc_prohibit_return_as_function:
halt='avoid extra () with return statements' \ halt='avoid extra () with return statements' \
$(_sc_search_regexp) $(_sc_search_regexp)
# ATTRIBUTE_UNUSED should only be applied in implementations, not # G_GNUC_UNUSED should only be applied in implementations, not
# header declarations # header declarations
sc_avoid_attribute_unused_in_header: sc_avoid_g_gnuc_unused_in_header:
@prohibit='^[^#]*ATTRIBUTE_UNUSED([^:]|$$)' \ @prohibit='^[^#]*G_GNUC_UNUSED([^:]|$$)' \
in_vc_files='\.h$$' \ in_vc_files='\.h$$' \
halt='use ATTRIBUTE_UNUSED in .c rather than .h files' \ halt='use G_GNUC_UNUSED in .c rather than .h files' \
$(_sc_search_regexp) $(_sc_search_regexp)
sc_prohibit_int_index: sc_prohibit_int_index:
@ -2295,7 +2295,7 @@ exclude_file_name_regexp--sc_prohibit_int_ijk = \
exclude_file_name_regexp--sc_prohibit_unsigned_pid = \ exclude_file_name_regexp--sc_prohibit_unsigned_pid = \
^(include/libvirt/.*\.h|src/(qemu/qemu_driver\.c|driver-hypervisor\.h|libvirt(-[a-z]*)?\.c|.*\.x|util/vir(polkit|systemd)\.c)|tests/virpolkittest\.c|tools/virsh-domain\.c)$$ ^(include/libvirt/.*\.h|src/(qemu/qemu_driver\.c|driver-hypervisor\.h|libvirt(-[a-z]*)?\.c|.*\.x|util/vir(polkit|systemd)\.c)|tests/virpolkittest\.c|tools/virsh-domain\.c)$$
exclude_file_name_regexp--sc_avoid_attribute_unused_in_header = \ exclude_file_name_regexp--sc_avoid_g_gnuc_unused_in_header = \
^(src/util/virlog\.h|src/network/bridge_driver\.h)$$ ^(src/util/virlog\.h|src/network/bridge_driver\.h)$$
exclude_file_name_regexp--sc_prohibit_mixed_case_abbreviations = \ exclude_file_name_regexp--sc_prohibit_mixed_case_abbreviations = \