From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8453A46148; Thu, 30 Jan 2025 09:37:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D78C40275; Thu, 30 Jan 2025 09:37:56 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 54CA340156 for ; Thu, 30 Jan 2025 09:37:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738226273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aTm8AZ8j4WDeWrENN5J7NaSQTJV6Guk8UNe/h9tMSG4=; b=J26JNokYUC7ApMThRgvODuJdKix0fNQmHdwJvjSJHMy8ObKNjiAeaXex7C04sh7t+1icCY 0CbD3KOz6TQ0hIv87PwXPVYmU1Iznr83rezZ5l0zGV1vE0kuANLSr9GQx5p3DapVTqPK5l 1PqLhEyWwWtWRTqzz8V+0PabL0SeaA4= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-49-lDM484qFMgmrB0_ZTxDmww-1; Thu, 30 Jan 2025 03:37:50 -0500 X-MC-Unique: lDM484qFMgmrB0_ZTxDmww-1 X-Mimecast-MFC-AGG-ID: lDM484qFMgmrB0_ZTxDmww Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B7DD71955DC9; Thu, 30 Jan 2025 08:37:48 +0000 (UTC) Received: from dmarchan.com (unknown [10.45.225.14]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7431018008C0; Thu, 30 Jan 2025 08:37:46 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: bruce.richardson@intel.com, andremue@linux.microsoft.com, roretzla@linux.microsoft.com, Thomas Monjalon Subject: [PATCH] devtools: forbid use of compiler pragmas Date: Thu, 30 Jan 2025 09:37:40 +0100 Message-ID: <20250130083741.3258965-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: EDHqWr7_zEnt1X9z1ix_vxCE7KG62kaSt3JwoO68j_0_1738226269 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Using pragma must be prevented to avoid breaking builds with other compilers. Let EAL use them (like for abstraction macros). Signed-off-by: David Marchand --- devtools/checkpatches.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 003bb49e04..c6920747f7 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -210,6 +210,15 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # forbid use of #pragma + awk -v FOLDERS='lib drivers app examples' \ + -v SKIP_FILES='lib/eal/include/rte_common.h' \ + -v EXPRESSIONS='(#pragma|_Pragma)' \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Using compilers pragma is not allowed' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + # forbid use of experimental build flag except in examples awk -v FOLDERS='lib drivers app' \ -v EXPRESSIONS='-DALLOW_EXPERIMENTAL_API allow_experimental_apis' \ -- 2.48.1