diff mbox series

[RFC,v2,2/4] developer: enable pedantic by default

Message ID 20210901091941.34886-3-carenas@gmail.com (mailing list archive)
State New, archived
Headers show
Series developer: support pedantic | expand

Commit Message

Carlo Marcelo Arenas Belón Sept. 1, 2021, 9:19 a.m. UTC
with the codebase firmly C99 compatible and most compilers supporting
newer versions by default, could help bring visibility to problems.

reverse the DEVOPTS=pedantic flag to provide a fallback for people stuck
with gcc < 5 or some other compiler that either doesn't support this flag
or has issues with it, and while at it also enable -Wpedantic which used
to be controversial when Apple compilers and clang had widely divergent
version numbers.

ideally any compiler found to have issues with these flags will be added
to an exception, but leaving it open for now as a weather balloon.

[1] https://lore.kernel.org/git/20181127100557.53891-1-carenas@gmail.com/

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 Makefile       | 4 ++--
 config.mak.dev | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 4e94073c2a..f7a2b20c77 100644
--- a/Makefile
+++ b/Makefile
@@ -486,9 +486,9 @@  all::
 #        setting this flag the exceptions are removed, and all of
 #        -Wextra is used.
 #
-#    pedantic:
+#    no-pedantic:
 #
-#        Enable -pedantic compilation.
+#        Disable -pedantic compilation.
 
 GIT-VERSION-FILE: FORCE
 	@$(SHELL_PATH) ./GIT-VERSION-GEN
diff --git a/config.mak.dev b/config.mak.dev
index 41d6345bc0..76f43dea3f 100644
--- a/config.mak.dev
+++ b/config.mak.dev
@@ -2,8 +2,9 @@  ifeq ($(filter no-error,$(DEVOPTS)),)
 DEVELOPER_CFLAGS += -Werror
 SPARSE_FLAGS += -Wsparse-error
 endif
-ifneq ($(filter pedantic,$(DEVOPTS)),)
+ifeq ($(filter no-pedantic,$(DEVOPTS)),)
 DEVELOPER_CFLAGS += -pedantic
+DEVELOPER_CFLAGS += -Wpedantic
 endif
 DEVELOPER_CFLAGS += -Wall
 DEVELOPER_CFLAGS += -Wdeclaration-after-statement