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>
'-ffunction-sections',
'-fno-common',
'-Wchar-subscripts',
- '-Wdeclaration-after-statement',
'-Wendif-labels',
'-Wfloat-equal',
'-Wformat=2',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wno-attributes=clang::suppress',
+ '-Wno-declaration-after-statement',
'-Wno-unused-parameter',
'-Wold-style-definition',
'-Wpointer-arith',