Skip to content

Commit 6a8cbc4

Browse files
carenasgitster
authored andcommitted
developer: enable pedantic by default
With the codebase firmly C99 compatible and most compilers supporting newer versions by default, it 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[1] 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, and indeed, one was added to safely process windows headers that would use non standard print identifiers, but it is expected that more will be needed, so it could be considered a weather balloon. [1] https://lore.kernel.org/git/[email protected]/ Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 27e0c3c commit 6a8cbc4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,9 @@ all::
486486
# setting this flag the exceptions are removed, and all of
487487
# -Wextra is used.
488488
#
489-
# pedantic:
489+
# no-pedantic:
490490
#
491-
# Enable -pedantic compilation.
491+
# Disable -pedantic compilation.
492492

493493
GIT-VERSION-FILE: FORCE
494494
@$(SHELL_PATH) ./GIT-VERSION-GEN

config.mak.dev

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ DEVELOPER_CFLAGS += -Werror
77
SPARSE_FLAGS += -Wsparse-error
88
endif
99
DEVELOPER_CFLAGS += -Wall
10-
ifneq ($(filter pedantic,$(DEVOPTS)),)
10+
ifeq ($(filter no-pedantic,$(DEVOPTS)),)
1111
DEVELOPER_CFLAGS += -pedantic
12+
DEVELOPER_CFLAGS += -Wpedantic
1213
ifneq ($(filter gcc5,$(COMPILER_FEATURES)),)
14+
DEVELOPER_CFLAGS += -Wno-pedantic-ms-format
1315
DEVELOPER_CFLAGS += -Wno-incompatible-pointer-types
1416
endif
1517
endif

0 commit comments

Comments
 (0)