[PATCH v1] devtools: allow variable declaration inside for loop

Bruce Richardson bruce.richardson at intel.com
Wed May 3 12:02:23 CEST 2023


On Wed, May 03, 2023 at 10:50:18AM +0100, Ferruh Yigit wrote:
> 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 at amd.com> --- Cc: Bruce
> Richardson <bruce.richardson at intel.com> Cc: David Marchand
> <david.marchand at redhat.com> --- devtools/checkpatches.sh | 8 -------- 1
> file changed, 8 deletions(-)
> 

Definite +1 from me for allowing this. However, is the plan still to move
to C99 in this release. I thought we were just going to jump to C11 in
23.11 release? However, I can't see any compilers refusing this if we do
relax things a bit now.

I was thinking that our coding standards doc might need an update for this,
but I don't see the restriction on not doing this documented there, so it
seems no doc change is necessary.

/Bruce


More information about the dev mailing list