DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] devtools: allow variable declaration inside for loop
@ 2023-05-03  9:50 Ferruh Yigit
  2023-05-03 10:02 ` Bruce Richardson
  2023-05-03 10:30 ` [PATCH v2] " Ferruh Yigit
  0 siblings, 2 replies; 9+ messages in thread
From: Ferruh Yigit @ 2023-05-03  9:50 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Bruce Richardson, David Marchand

Declaring variable inside for loop is not supported via C89 and it was
checked in checkpatch.sh via commit [1].
But as DPDK supported C standard is becoming C99 [2], declaring variable
inside loop can be allowed.

[1]
Commit 43e73483a4b8 ("devtools: forbid variable declaration inside for")

[2]
https://dpdk.org/patch/121912

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: Bruce Richardson <bruce.richardson@intel.com>
Cc: David Marchand <david.marchand@redhat.com>
---
 devtools/checkpatches.sh | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 15d5d6709445..b5baf6f2b161 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -78,14 +78,6 @@ check_forbidden_additions() { # <patch>
 		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
 		"$1" || res=1
 
-	# forbid variable declaration inside "for" loop
-	awk -v FOLDERS='.' \
-		-v EXPRESSIONS='for[[:space:]]*\\((char|u?int|unsigned|s?size_t)' \
-		-v RET_ON_FAIL=1 \
-		-v MESSAGE='Declaring a variable inside for()' \
-		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
-		"$1" || res=1
-
 	# refrain from new additions of 16/32/64 bits rte_atomicNN_xxx()
 	awk -v FOLDERS="lib drivers app examples" \
 		-v EXPRESSIONS="rte_atomic[0-9][0-9]_.*\\\(" \
-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-20  4:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-03  9:50 [PATCH v1] devtools: allow variable declaration inside for loop Ferruh Yigit
2023-05-03 10:02 ` Bruce Richardson
2023-05-03 10:23   ` Ferruh Yigit
2023-05-03 10:30 ` [PATCH v2] " Ferruh Yigit
2023-05-03 10:57   ` Bruce Richardson
2023-05-03 12:19     ` Morten Brørup
2023-05-03 15:01       ` Thomas Monjalon
2023-05-03 15:06         ` Tyler Retzlaff
2023-07-20  4:05           ` 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).