* [PATCH] devtools: forbid use of compiler pragmas
@ 2025-01-30 8:37 David Marchand
2025-01-30 8:45 ` Morten Brørup
0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2025-01-30 8:37 UTC (permalink / raw)
To: dev; +Cc: bruce.richardson, andremue, roretzla, Thomas Monjalon
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] devtools: forbid use of compiler pragmas
2025-01-30 8:37 [PATCH] devtools: forbid use of compiler pragmas David Marchand
@ 2025-01-30 8:45 ` Morten Brørup
2025-01-30 8:52 ` David Marchand
0 siblings, 1 reply; 3+ messages in thread
From: Morten Brørup @ 2025-01-30 8:45 UTC (permalink / raw)
To: David Marchand, dev; +Cc: bruce.richardson, andremue, roretzla, Thomas Monjalon
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Thursday, 30 January 2025 09.38
>
> Using pragma must be prevented to avoid breaking builds with other
> compilers.
> Let EAL use them (like for abstraction macros).
You are only allowing them in rte_common.h.
Do we need them elsewhere in EAL?
Not that I think so, but the patch description could be interpreted that way.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Good idea!
Acked-by: Morten Brørup <mb@smartsharesystems.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] devtools: forbid use of compiler pragmas
2025-01-30 8:45 ` Morten Brørup
@ 2025-01-30 8:52 ` David Marchand
0 siblings, 0 replies; 3+ messages in thread
From: David Marchand @ 2025-01-30 8:52 UTC (permalink / raw)
To: Morten Brørup
Cc: dev, bruce.richardson, andremue, roretzla, Thomas Monjalon
On Thu, Jan 30, 2025 at 9:45 AM Morten Brørup <mb@smartsharesystems.com> wrote:
>
> > From: David Marchand [mailto:david.marchand@redhat.com]
> > Sent: Thursday, 30 January 2025 09.38
> >
> > Using pragma must be prevented to avoid breaking builds with other
> > compilers.
> > Let EAL use them (like for abstraction macros).
>
> You are only allowing them in rte_common.h.
> Do we need them elsewhere in EAL?
> Not that I think so, but the patch description could be interpreted that way.
Ah yes, I forgot to update description afterwards.
I can update when applying.
>
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
>
> Good idea!
>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
--
David Marchand
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-30 8:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-30 8:37 [PATCH] devtools: forbid use of compiler pragmas David Marchand
2025-01-30 8:45 ` Morten Brørup
2025-01-30 8:52 ` David Marchand
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).