From: Jim Meyering Date: Fri, 9 Jun 2023 17:15:30 +0000 (-0700) Subject: maint.mk: sc_prohibit_xalloc_without_use: also match alloc_die X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=95a690c4f068ffd9cc9a3fea77edd44f8b91bab7;p=gnulib.git maint.mk: sc_prohibit_xalloc_without_use: also match alloc_die * top/maint.mk (sc_prohibit_xalloc_without_use): Adjust in-comment command's regexp so it also finds alloc_die, whose declaration has a prefix of "_Noreturn" . Also delete some now-obsolete commentary. (_xa1): Regenerate the regexp using that command. Reported by Pádraig Brady in . --- diff --git a/ChangeLog b/ChangeLog index 150153626c..81df887afd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2023-06-09 Jim Meyering + + maint.mk: sc_prohibit_xalloc_without_use: also match alloc_die + * top/maint.mk (sc_prohibit_xalloc_without_use): + Adjust in-comment command's regexp so it also finds alloc_die, + whose declaration has a prefix of "_Noreturn ". + Also delete some now-obsolete commentary. + (_xa1): Regenerate the regexp using that command. + Reported by Pádraig Brady in + . + 2023-06-09 Paul Eggert xalloc-die: omit /*extern*/ diff --git a/top/maint.mk b/top/maint.mk index 6086cd3417..b8bbe1e6ec 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -180,7 +180,7 @@ no-vc-detected: endif .PHONY: $(local-checks-available) -# Arrange to print the name of each syntax-checking rule just before running it. +# Arrange to prine the name of each syntax-checking rule just before running it. $(syntax-check-rules): %: %.m sc_m_rules_ = $(patsubst %, %.m, $(syntax-check-rules)) .PHONY: $(sc_m_rules_) @@ -598,23 +598,14 @@ sc_prohibit_error_without_use: re='\new(file => "/dev/stdin")->as_string'|sed 's/\?://g' -# Note this was produced by the above: -# _xa1 = \ -#x(((2n?)?re|c(har)?|n(re|m)|z)alloc|alloc_(oversized|die)|m(alloc|emdup)|strdup) -# But we can do better, in at least two ways: -# 1) take advantage of two "dup"-suffixed strings: -# x(((2n?)?re|c(har)?|n(re|m)|[mz])alloc|alloc_(oversized|die)|(mem|str)dup) -# 2) notice that "c(har)?|[mz]" is equivalent to the shorter and more readable -# "char|[cmz]" -# x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup) -_xa1 = x(i(m(emdup0?|alloc)|realloc(array)?|([cz]|nm)alloc)|([pz]|c(har)?|2n?re|nm)alloc|realloc(array)?|m(alloc|emdup)|strdup) +_xa1 = x(i(m(emdup0?|alloc)|realloc(array)?|([cz]|nm)alloc)|([pz]|c(har)?|2n?re|nm)alloc|realloc(array)?|m(alloc|emdup)|alloc_die|strdup) _xa2 = X([CZ]|N?M)ALLOC sc_prohibit_xalloc_without_use: @h='xalloc.h' \