DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, andremue@linux.microsoft.com,
	roretzla@linux.microsoft.com,
	Thomas Monjalon <thomas@monjalon.net>
Subject: [PATCH] devtools: forbid use of compiler pragmas
Date: Thu, 30 Jan 2025 09:37:40 +0100	[thread overview]
Message-ID: <20250130083741.3258965-1-david.marchand@redhat.com> (raw)

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 <david.marchand@redhat.com>
---
 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() { # <patch>
 		-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


             reply	other threads:[~2025-01-30  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30  8:37 David Marchand [this message]
2025-01-30  8:45 ` Morten Brørup
2025-01-30  8:52   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250130083741.3258965-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=andremue@linux.microsoft.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=roretzla@linux.microsoft.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).