diff mbox

[ndctl] ndctl: warn on variables declared after statement

Message ID 152606086348.37490.2328471829579138286.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Williams May 11, 2018, 5:47 p.m. UTC
Similar to the kernel, require all variables to be declared before
statements.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 configure.ac |    1 +
 1 file changed, 1 insertion(+)

Comments

Verma, Vishal L May 11, 2018, 6:02 p.m. UTC | #1
On Fri, 2018-05-11 at 10:47 -0700, Dan Williams wrote:
> Similar to the kernel, require all variables to be declared before
> statements.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  configure.ac |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configure.ac b/configure.ac
> index 6dbfcee88f7d..da56c413bffd 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -148,6 +148,7 @@ my_CFLAGS="\
>  -Wstrict-prototypes \
>  -Wtype-limits \
>  -Wmaybe-uninitialized \
> +-Wdeclaration-after-statement \
>  -Wunused-result \
>  -D_FORTIFY_SOURCE=2
>  "
> 

Thanks Dan, applied.
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 6dbfcee88f7d..da56c413bffd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,6 +148,7 @@  my_CFLAGS="\
 -Wstrict-prototypes \
 -Wtype-limits \
 -Wmaybe-uninitialized \
+-Wdeclaration-after-statement \
 -Wunused-result \
 -D_FORTIFY_SOURCE=2
 "