From 729b3925ed962565e0d6cc144a4235fdf9a6aa85 Mon Sep 17 00:00:00 2001 From: Beat Bolli Date: Tue, 24 Jul 2018 21:26:43 +0200 Subject: Makefile: add a DEVOPTS flag to get pedantic compilation In the interest of code hygiene, make it easier to compile Git with the flag -pedantic. Pure pedantic compilation with GCC 7.3 results in one warning per use of the translation macro `N_`: warning: array initialized from parenthesized string constant [-Wpedantic] Therefore also disable the parenthesising of i18n strings with -DUSE_PARENS_AROUND_GETTEXT_N=0. Signed-off-by: Beat Bolli Signed-off-by: Junio C Hamano --- config.mak.dev | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config.mak.dev') diff --git a/config.mak.dev b/config.mak.dev index 2d244ca470..9a998149d9 100644 --- a/config.mak.dev +++ b/config.mak.dev @@ -1,6 +1,11 @@ ifeq ($(filter no-error,$(DEVOPTS)),) CFLAGS += -Werror endif +ifneq ($(filter pedantic,$(DEVOPTS)),) +CFLAGS += -pedantic +# don't warn for each N_ use +CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0 +endif CFLAGS += -Wdeclaration-after-statement CFLAGS += -Wno-format-zero-length CFLAGS += -Wold-style-definition -- cgit v1.2.3