From nobody Tue Feb 10 16:18:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327555; cv=none; d=zohomail.com; s=zohoarc; b=LCovokZeVZPGJ2ip6mSaTKqv8/7JGto7DCiMdelsa91fbigTx3gkSUP08o7UF5nQDM4gCnTGHIgAO/B2Gs5k7AAnzxkU6wzpqTvT3rtYsMFVNU5DILB+r0A8p3TzFutSlP+LYu67IffnDOcO/t23QPpD0kHZMiWNqnMjie8uPKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327555; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=b9dEsxUk34MlJrv8iciNs4jssVuiKP4JNnlfR3s3mUE=; b=RMSWpfs1Qf1bcN0hOAC88AmQ1UrBnboBvjdG5+PQCHWXylDLE8qdDy2Hoif9Z4wK/YWJOU8Gv8mK8RC+i2F7PfDmbdzff0WT2jhytt2/gEiwlSSu9eMHcPObFQewmz2LgDjl70zChTsmHjUNeeeelOnhmYnS2u8CF/mlBBGGpwc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16533275557491016.413600403848; Mon, 23 May 2022 10:39:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-192-mRh_GSj9Pp6tl6ohZVL_rA-1; Mon, 23 May 2022 13:38:25 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE3B4185A79C; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A59D6492C14; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6A0AE194705F; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3A4291947059 for ; Mon, 23 May 2022 17:38:03 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1B31B1121331; Mon, 23 May 2022 17:38:03 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 755B3112131E for ; Mon, 23 May 2022 17:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327554; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=b9dEsxUk34MlJrv8iciNs4jssVuiKP4JNnlfR3s3mUE=; b=eXFTPVXa6x/1qBVfsXSQ+I+QMNF2OLd8b4NCIVYOZQn2tlonOi3M9Z/oUzvQOaDIrVc+kV hlICn2df4IwWrsj9ETGaQOCLR9CcPNBfNQSuNnTUUXuhQMtDvaeenaoXm3QAyHwy5mrCMr ZUuJnXoMS9MzJWOQpS4VILRVYIGRGsg= X-MC-Unique: mRh_GSj9Pp6tl6ohZVL_rA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 08/13] syntax-check: Drop ME variable Date: Mon, 23 May 2022 19:37:49 +0200 Message-Id: <20220523173754.336735-9-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327556170100002 Content-Type: text/plain; charset="utf-8" It's only used in diagnostics, and even there it's not particularly useful and can make it more difficult to spot the actual error message. Signed-off-by: Andrea Bolognani --- build-aux/syntax-check.mk | 58 ++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index da0140c355..4573655074 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -19,10 +19,6 @@ # along with this program. If not, see # . =20 -# This is reported not to work with make-3.79.1 -# ME :=3D $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -ME :=3D build-aux/syntax-check.mk - # These variables ought to be defined through the configure.ac section # of the module description. But some packages import this file directly, # ignoring the module description. @@ -103,7 +99,7 @@ sc_flags_usage: $(top_srcdir)/include/libvirt/libvirt-lxc.h \ $(top_srcdir)/include/libvirt/libvirt-admin.h \ | $(GREP) -c '\(long\|unsigned\) flags')" !=3D 4 && \ - { echo '$(ME): new API should use "unsigned int flags"' 1>&2; \ + { echo 'new API should use "unsigned int flags"' 1>&2; \ exit 1; } || : @prohibit=3D' flags G_GNUC_UNUSED' \ exclude=3D'virSecurityDomainImageLabelFlags' \ @@ -466,7 +462,7 @@ sc_libvirt_unmarked_diagnostics: $(GREP) -A1 -nE '\<$(func_re) *\(.*,$$' /dev/null; } \ | $(SED) -E 's/_\("([^\"]|\\.)+"//;s/"%s"//' \ | $(GREP) '"' && \ - { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ + { echo 'found unmarked diagnostic(s)' 1>&2; \ exit 1; } || : =20 # Like the above, but prohibit a newline at the end of a diagnostic. @@ -480,7 +476,7 @@ sc_prohibit_newline_at_end_of_diagnostic: @$(VC_LIST_EXCEPT) | xargs $(GREP) -A2 -nE \ '\<$(func_re) *\(' /dev/null \ | $(GREP) '\\n"' \ - && { echo '$(ME): newline at end of message(s)' 1>&2; \ + && { echo 'newline at end of message(s)' 1>&2; \ exit 1; } || : =20 # Look for diagnostics that lack a % in the format string, except that we @@ -495,7 +491,7 @@ sc_prohibit_diagnostic_without_format: -e '/(vah_(error|warning))/d' \ -e '/\<$(func_re) *\([^"]*"([^%"]|"\n[^"]*")*"[,)]/p' \ | $(GREP) -vE 'VIR_ERROR' && \ - { echo '$(ME): found diagnostic without %' 1>&2; \ + { echo 'found diagnostic without %' 1>&2; \ exit 1; } || : =20 # The strings "" and "%s" should never be marked for translation. @@ -515,17 +511,17 @@ sc_require_whitespace_in_translation: @$(VC_LIST_EXCEPT) | xargs $(GREP) -n -A1 '"$$' /dev/null \ | $(SED) -ne ':l; /"$$/ {N;b l;}; s/"\n[^"]*"/""/g; s/\\n/ /g' \ -e '/_(.*[^\ ]""[^\ ]/p' | $(GREP) . && \ - { echo '$(ME): missing whitespace at line split' 1>&2; \ + { echo 'missing whitespace at line split' 1>&2; \ exit 1; } || : =20 # Enforce recommended preprocessor indentation style. sc_preprocessor_indentation: @if cppi --version >/dev/null 2>&1; then \ $(VC_LIST_EXCEPT) | $(GREP) -E '\.[ch](\.in)?$$' | xargs cppi -a -c \ - || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \ + || { echo 'incorrect preprocessor indentation' 1>&2; \ exit 1; }; \ else \ - echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ + echo 'skipping test $@: cppi not installed' 1>&2; \ fi =20 # Enforce similar spec file indentation style, by running cppi on a @@ -539,10 +535,10 @@ sc_spec_indentation: -e 's|^\( *[^#/ ]\)|// \1|; s|^\( */[^/]\)|// \1|' $$f \ | cppi -a -c 2>&1 | $(SED) "s|standard input|$$f|"; \ done | { if $(GREP) . >&2; then false; else :; fi; } \ - || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \ + || { echo 'incorrect preprocessor indentation' 1>&2; \ exit 1; }; \ else \ - echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ + echo 'skipping test $@: cppi not installed' 1>&2; \ fi =20 =20 @@ -601,7 +597,7 @@ sc_require_enum_last_marker: -e '/VIR_ENUM_IMPL[^,]*,[^,]*,[^,]*[^_,][^L,][^A,][^S,][^T,],/p' \ -e '/VIR_ENUM_IMPL[^,]*,[^,]\{0,4\},/p' \ | $(GREP) . && \ - { echo '$(ME): enum impl needs _LAST marker on second line' 1>&2; \ + { echo 'enum impl needs _LAST marker on second line' 1>&2; \ exit 1; } || : =20 # We're intentionally ignoring a few warnings @@ -623,7 +619,7 @@ sc_flake8: ALL_PY=3D$$(printf "%s\n%s" "$$DOT_PY" "$$BANG_PY" | sort -u); \ echo "$$ALL_PY" | xargs $(FLAKE8) --ignore $(FLAKE8_IGNORE) --show-sourc= e; \ else \ - echo '$(ME): skipping test $@: flake8 not installed' 1>&2; \ + echo 'skipping test $@: flake8 not installed' 1>&2; \ fi =20 # mymain() in test files should use return, not exit, for nicer output @@ -685,7 +681,7 @@ sc_prohibit_wrong_filename_in_comment: if (fail =3D=3D 1) { \ exit 1; \ } \ - }' || { echo '$(ME): The file name in comments must match the' \ + }' || { echo 'The file name in comments must match the' \ 'actual file name' 1>&2; exit 1; } =20 sc_prohibit_virConnectOpen_in_virsh: @@ -720,18 +716,18 @@ sc_curly_braces_style: @if $(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs $(GREP) -nHP \ '^\s*(?!([a-zA-Z_]*for_?each[a-zA-Z_]*) ?\()([_a-zA-Z0-9]+( [_a-zA-Z0-9]+)= * ?\()?(\*?[_a-zA-Z0-9]+(,? \*?[_a-zA-Z0-9\[\]]+)+|void)\) ?\{' \ /dev/null; then \ - echo '$(ME): Non-K&R style used for curly braces around' \ + echo 'Non-K&R style used for curly braces around' \ 'function body' 1>&2; exit 1; \ fi; \ if $(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs \ $(GREP) -A1 -En ' ((if|for|while|switch) \(|(else|do)\b)[^{]*$$' \ /dev/null | $(GREP) '^[^ ]*- *{'; then \ - echo '$(ME): Use hanging braces for compound statements' 1>&2; exit 1; \ + echo 'Use hanging braces for compound statements' 1>&2; exit 1; \ fi =20 sc_prohibit_windows_special_chars_in_filename: @$(VC_LIST_EXCEPT) | $(GREP) '[:*?"<>|]' && \ - { echo '$(ME): Windows special chars in filename not allowed' 1>&2; echo = exit 1; } || : + { echo 'Windows special chars in filename not allowed' 1>&2; echo exit 1;= } || : =20 sc_prohibit_mixed_case_abbreviations: @prohibit=3D'Pci|Usb|Scsi|Vpd' \ @@ -751,7 +747,7 @@ sc_prohibit_empty_first_line: FNR =3D=3D 1 { maybe_fail =3D $$0 =3D=3D ""; } \ FNR =3D=3D 2 { if (maybe_fail =3D=3D 1) { print FILENAME ":1:"; fail=3D1;= } } \ END { if (fail =3D=3D 1) { \ - print "$(ME): Prohibited empty first line" > "/dev/stderr"; \ + print "Prohibited empty first line" > "/dev/stderr"; \ } exit fail; }' =20 sc_prohibit_paren_brace: @@ -798,7 +794,7 @@ sc_prohibit_virSecurityManager: @$(VC_LIST_EXCEPT) | $(GREP) 'src/qemu/' | \ $(GREP) -v 'src/qemu/qemu_security' | \ xargs $(GREP) -Pn 'virSecurityManager\S*\(' /dev/null && \ - { echo '$(ME): prefer qemuSecurity wrappers' 1>&2; exit 1; } || : + { echo 'prefer qemuSecurity wrappers' 1>&2; exit 1; } || : =20 sc_prohibit_pthread_create: @prohibit=3D'\bpthread_create\b' \ @@ -1009,7 +1005,7 @@ _ignore_case =3D $$(test -n "$$ignore_case" && printf= %s -i || :) =20 define _sc_say_and_exit dummy=3D; : so we do not need a semicolon before each use; \ - { printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; }; + { printf '%s\n' "$$msg" 1>&2; exit 1; }; endef =20 define _sc_search_regexp @@ -1120,7 +1116,7 @@ sc_error_message_warn_fatal: @$(VC_LIST_EXCEPT) \ | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ | $(GREP) -E '"Warning|"Fatal|"fatal' \ - && { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \ + && { echo 'use FATAL, WARNING or warning' 1>&2; \ exit 1; } \ || : =20 @@ -1129,7 +1125,7 @@ sc_error_message_period: @$(VC_LIST_EXCEPT) \ | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ | $(GREP) -E '[^."]\."' \ - && { echo '$(ME): found error message ending in period' 1>&2; \ + && { echo 'found error message ending in period' 1>&2; \ exit 1; } \ || : =20 @@ -1169,7 +1165,7 @@ sc_require_config_h_first: @if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \ files=3D$$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$') && \ perl -n $(perl_config_h_first_) $$files || \ - { echo '$(ME): the above files include some other header' \ + { echo 'the above files include some other header' \ 'before ' 1>&2; exit 1; } || :; \ else :; \ fi @@ -1184,7 +1180,7 @@ define _sc_header_without_use files=3D$$($(GREP) -l '^# *include '"$$h_esc" \ $$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$')) && \ $(GREP) -LE "$$re" $$files | $(GREP) . && \ - { echo "$(ME): the above files include $$h but don't use it" \ + { echo "the above files include $$h but don't use it" \ 1>&2; exit 1; } || :; \ else :; \ fi @@ -1285,7 +1281,7 @@ sc_prohibit_defined_have_decl_tests: # Prohibit checked in backup files. sc_prohibit_backup_files: @$(VC_LIST_EXCEPT) | $(GREP) '~$$' && \ - { echo '$(ME): found version controlled backup file' 1>&2; \ + { echo 'found version controlled backup file' 1>&2; \ exit 1; } || : =20 # This Perl code is slightly obfuscated. Not only is each "$" doubled @@ -1329,7 +1325,7 @@ require_exactly_one_NL_at_EOF_ =3D \ sc_prohibit_empty_lines_at_EOF: @$(VC_LIST_EXCEPT) \ | xargs perl -le '$(require_exactly_one_NL_at_EOF_)' \ - || { echo '$(ME): empty line(s) or no newline at EOF' 1>&2; \ + || { echo 'empty line(s) or no newline at EOF' 1>&2; \ exit 1; } \ || : =20 @@ -1364,7 +1360,7 @@ sc_prohibit_doubled_word: | xargs perl -n -0777 $(prohibit_doubled_word_) \ | $(GREP) -vE '$(ignore_doubled_word_match_RE_)' \ | $(GREP) . \ - && { echo '$(ME): doubled words' 1>&2; exit 1; } \ + && { echo 'doubled words' 1>&2; exit 1; } \ || : =20 # Except for shell files and for loops, double semicolon is probably a mis= take @@ -1447,7 +1443,7 @@ sc_po_check: | $(SED) 's|^$(_dot_escaped_srcdir)/||' \ | sort -u > $@-2; \ diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ - || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \ + || { printf $(fix_po_file_diag) 1>&2; exit 1; }; \ rm -f $@-1 $@-2; \ fi =20 @@ -1501,7 +1497,7 @@ sc_prohibit-duplicate-header: sc_spacing-check: $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.c$$' | xargs \ $(PERL) $(top_srcdir)/build-aux/check-spacing.pl || \ - { echo '$(ME): incorrect formatting' 1>&2; exit 1; } + { echo 'incorrect formatting' 1>&2; exit 1; } =20 sc_mock-noinline: $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | $(RUNUTF8) \ --=20 2.35.3