]> git.ipfire.org Git - thirdparty/kmod.git/commit
meson: disable Wdeclaration-after-statement
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 24 May 2025 16:40:47 +0000 (17:40 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 29 May 2025 22:07:52 +0000 (17:07 -0500)
commitb1f9213931846fdad7455a5cac507a68000de220
tree1db01cb052b59214289ee78105ba3f4c1db7c58a
parentbd51c99c35fe7b9e2acee75c8861444d3b734456
meson: disable Wdeclaration-after-statement

Having declarations after statement is a C90 requirement, which was
relaxed with C99. While there are some arguments for having it enabled
in new code, there are benefits to the contrary which are more appealing
IMHO.

Namely, by keeping the declarations where the variables are used, better
outlines the scope, reduces chances of shadowing and helps us avoid
"unused variable" compiler warning in some paths.

Flip the warning to -Wno for now and future patches can remove some of
the workarounds we have in-tree.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/360
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
meson.build