summaryrefslogtreecommitdiff
path: root/config.mak.dev
diff options
context:
space:
mode:
authorBeat Bolli <dev+git@drbeat.li>2018-07-24 19:26:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-25 16:52:32 (GMT)
commit729b3925ed962565e0d6cc144a4235fdf9a6aa85 (patch)
tree9c069b13f589756cbb1c59b0cd81b6a88eb9964a /config.mak.dev
parent2b647a05d7223beacba076e45b3920a8621d28e7 (diff)
downloadgit-729b3925ed962565e0d6cc144a4235fdf9a6aa85.zip
git-729b3925ed962565e0d6cc144a4235fdf9a6aa85.tar.gz
git-729b3925ed962565e0d6cc144a4235fdf9a6aa85.tar.bz2
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 <dev+git@drbeat.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.mak.dev')
-rw-r--r--config.mak.dev5
1 files changed, 5 insertions, 0 deletions
diff --git a/config.mak.dev b/config.mak.dev
index 2d244ca..9a99814 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