syntax-check: Sync with gnulib

The most notable change is the new 'sc_unportable_grep_q' rule.

While importing it from gnulib, the rule has been tweaked
slightly by adding superflous quotes so that syntax-check.mk
itself doesn't trip it. This is similar to the tricks employed
for the 'sc_prohibit_close' and 'sc_copyright_usage' rules,
among many others.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Andrea Bolognani 2024-02-16 15:09:45 +01:00
parent 1664b1414e
commit e14c2d32d2

View File

@ -1,13 +1,12 @@
#
# Rules for running syntax-check, derived from gnulib's
# maint.mk
# Rules for running syntax-check, derived from gnulib's top/maint.mk
#
# Specifically, all shared code should match gnulib commit
#
# dd2503c8e73621e919e8e214a29c495ac89d8a92 (2022-05-21)
# d5191e456737661d4a0df5287f6c2064ab74dbbe (2024-02-15)
#
# Copyright (C) 2008-2019 Red Hat, Inc.
# Copyright (C) 2001-2022 Free Software Foundation, Inc.
# Copyright (C) 2001-2024 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -1083,7 +1082,8 @@ sc_prohibit_stdio--_without_use:
@h='stdio--.h' re='\<((f(re)?|p)open|tmpfile) *\(' \
$(_sc_header_without_use)
_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
_stddef_syms_re = \
NULL|max_align_t|nullptr_t|offsetof|ptrdiff_t|size_t|unreachable|wchar_t
# Prohibit the inclusion of stddef.h without an actual use.
sc_prohibit_stddef_without_use:
@h='stddef.h' \
@ -1310,6 +1310,10 @@ sc_prohibit_path_max_allocation:
halt='Avoid stack allocations of size PATH_MAX' \
$(_sc_search_regexp)
sc_unportable_grep_q:
@prohibit='grep ''-q' halt="unportable 'grep ""-q', use >/dev/null instead" \
$(_sc_search_regexp)
ifneq ($(_gl-Makefile),)
syntax-check: sc_spacing-check \
sc_prohibit-duplicate-header sc_mock-noinline sc_group-qemu-caps \