]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
build-src.mk: CFLAGS: Add -Wdeclaration-after-statement
authorAlejandro Colomar <alx@kernel.org>
Wed, 25 Jan 2023 23:02:16 +0000 (00:02 +0100)
committerAlejandro Colomar <alx@kernel.org>
Thu, 26 Jan 2023 00:01:55 +0000 (01:01 +0100)
This helps write more readable code, separating variable declarations
from code.  In some cases, when initializing structs, or declaring some
VLAs, we can't follow the rule, so don't make it an error.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/build-src.mk

index 1ca99e98a230bebff55d928c076fba9c1ff04eed..b6ec587b113c69ef0684c612d6d7c6a4e95613d2 100644 (file)
@@ -26,11 +26,13 @@ DEFAULT_CFLAGS := -std=gnu17
 DEFAULT_CFLAGS += -Wall
 DEFAULT_CFLAGS += -Wextra
 DEFAULT_CFLAGS += -Wstrict-prototypes
+DEFAULT_CFLAGS += -Wdeclaration-after-statement
 DEFAULT_CFLAGS += -Werror
 DEFAULT_CFLAGS += -Wno-error=unused-parameter
 DEFAULT_CFLAGS += -Wno-error=sign-compare
 DEFAULT_CFLAGS += -Wno-error=format
 DEFAULT_CFLAGS += -Wno-error=uninitialized
+#DEFAULT_CFLAGS += -Wno-error=declaration-after-statement
 EXTRA_CFLAGS   :=
 CFLAGS         := $(DEFAULT_CFLAGS) $(EXTRA_CFLAGS)