* [dpdk-dev] [PATCH] devtools: forbid additions of __reserved
@ 2021-10-23 10:29 David Marchand
2021-10-27 10:00 ` Bruce Richardson
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: David Marchand @ 2021-10-23 10:29 UTC (permalink / raw)
To: dev; +Cc: dmitry.kozliuk, Thomas Monjalon
__reserved is a reserved keyword in Windows system headers.
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 c314d83a29..25f60a4a27 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -134,6 +134,15 @@ check_forbidden_additions() { # <patch>
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
+ # refrain from using __reserved which is a reserved keyword in Windows
+ # system headers
+ awk -v FOLDERS="lib drivers app examples" \
+ -v EXPRESSIONS='\\<__reserved\\>' \
+ -v RET_ON_FAIL=1 \
+ -v MESSAGE='Using __reserved' \
+ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+ "$1" || res=1
+
# SVG must be included with wildcard extension to allow conversion
awk -v FOLDERS='doc' \
-v EXPRESSIONS='::[[:space:]]*[^[:space:]]*\\.svg' \
--
2.23.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] devtools: forbid additions of __reserved
2021-10-23 10:29 [dpdk-dev] [PATCH] devtools: forbid additions of __reserved David Marchand
@ 2021-10-27 10:00 ` Bruce Richardson
2021-10-28 13:27 ` Walsh, Conor
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Bruce Richardson @ 2021-10-27 10:00 UTC (permalink / raw)
To: David Marchand; +Cc: dev, dmitry.kozliuk, Thomas Monjalon
On Sat, Oct 23, 2021 at 12:29:00PM +0200, David Marchand wrote:
> __reserved is a reserved keyword in Windows system headers.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] devtools: forbid additions of __reserved
2021-10-23 10:29 [dpdk-dev] [PATCH] devtools: forbid additions of __reserved David Marchand
2021-10-27 10:00 ` Bruce Richardson
@ 2021-10-28 13:27 ` Walsh, Conor
2021-11-11 5:45 ` Tyler Retzlaff
2021-11-26 17:18 ` Thomas Monjalon
3 siblings, 0 replies; 5+ messages in thread
From: Walsh, Conor @ 2021-10-28 13:27 UTC (permalink / raw)
To: David Marchand, dev; +Cc: dmitry.kozliuk, Thomas Monjalon
> From: dev <dev-bounces@dpdk.org> On Behalf Of David Marchand
> Sent: Saturday 23 October 2021 11:29
> To: dev@dpdk.org
> Cc: dmitry.kozliuk@gmail.com; Thomas Monjalon <thomas@monjalon.net>
> Subject: [dpdk-dev] [PATCH] devtools: forbid additions of __reserved
>
> __reserved is a reserved keyword in Windows system headers.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Tested-by: Conor Walsh <conor.walsh@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] devtools: forbid additions of __reserved
2021-10-23 10:29 [dpdk-dev] [PATCH] devtools: forbid additions of __reserved David Marchand
2021-10-27 10:00 ` Bruce Richardson
2021-10-28 13:27 ` Walsh, Conor
@ 2021-11-11 5:45 ` Tyler Retzlaff
2021-11-26 17:18 ` Thomas Monjalon
3 siblings, 0 replies; 5+ messages in thread
From: Tyler Retzlaff @ 2021-11-11 5:45 UTC (permalink / raw)
To: David Marchand; +Cc: dev, dmitry.kozliuk, Thomas Monjalon
On Sat, Oct 23, 2021 at 12:29:00PM +0200, David Marchand wrote:
> __reserved is a reserved keyword in Windows system headers.
>
fwiw it's the c standard that stipulates identifiers starting with __
are reserved for any use.
C11/C99 "ANSI-C"
7.1.3 Reserved Identifiers
`All identifiers that begin with an underscore and either an
uppercase letter or another underscore are always reserved for
any use.'
Public DPDK headers are also subject to the C++ standard.
C++ (n3690)
5.10 Identifiers
`(3.1) -- Each identifier that contains a double underscore __ or
begins with an underscore followed by an uppercase letter is reserved
to the implementation for any use.'
`(3.2) -- Each identifier that begins with an underscore is reserved
to the implementation for use as a name in the global namespace.'
dpdk is pretty comprehensive in violating these clauses with
identifiers of the form `__rte_’ fortunately since preprocessors,
compilers, standard library headers are unlikely to use `rte’ it’s
fairly safe in spite of being non-compliant.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] devtools: forbid additions of __reserved
2021-10-23 10:29 [dpdk-dev] [PATCH] devtools: forbid additions of __reserved David Marchand
` (2 preceding siblings ...)
2021-11-11 5:45 ` Tyler Retzlaff
@ 2021-11-26 17:18 ` Thomas Monjalon
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2021-11-26 17:18 UTC (permalink / raw)
To: David Marchand; +Cc: dev, dmitry.kozliuk
23/10/2021 12:29, David Marchand:
> __reserved is a reserved keyword in Windows system headers.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
[...]
> + # refrain from using __reserved which is a reserved keyword in Windows
> + # system headers
Reworded as "forbid"
Applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-11-26 17:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-23 10:29 [dpdk-dev] [PATCH] devtools: forbid additions of __reserved David Marchand
2021-10-27 10:00 ` Bruce Richardson
2021-10-28 13:27 ` Walsh, Conor
2021-11-11 5:45 ` Tyler Retzlaff
2021-11-26 17:18 ` Thomas Monjalon
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).