git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 3/4] Makefile: add a DEVOPTS to suppress -Werror under DEVELOPER

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 14, 2018, 19:19 UTC
Message-ID
<20180414191946.30674-4-avarab@gmail.com>
In-Reply-To
<20180414191946.30674-1-avarab@gmail.com>

Add a DEVOPTS variable that'll be used to tweak the behavior of DEVELOPER.

I've long wanted to use DEVELOPER=1 in my production builds, but on some old systems I still get warnings, and thus the build would fail. However if the build/tests fail for some other reason, it would still be useful to scroll up and see what the relevant code is warning about.

This change allows for that. Now setting DEVELOPER will set -Werror as before, but if DEVOPTS=no-error is provided is set you'll get the same warnings, but without -Werror.

Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile       | 10 ++++++++++
 config.mak.dev |  2 ++
 2 files changed, 12 insertions(+)
diff --git a/Makefile b/Makefile
index 3038c78325..9a57495fae 100644
--- a/Makefile
+++ b/Makefile
@@ -445,6 +445,16 @@ all::
 # Define DEVELOPER to enable more compiler warnings. Compiler version
 # and family are auto detected, but could be overridden by defining
 # COMPILER_FEATURES (see config.mak.dev)
+#
+# When DEVELOPER is set, DEVOPTS can be used to control compiler
+# options.  This variable contains keywords separated by
+# whitespace. The following keywords are are recognized:
+#
+#    no-error:
+#
+#        suppresses the -Werror that implicitly comes with
+#        DEVELOPER=1. Useful for getting the full set of errors
+#        without immediately dying, or for logging them.
 
 GIT-VERSION-FILE: FORCE
 	@$(SHELL_PATH) ./GIT-VERSION-GEN
diff --git a/config.mak.dev b/config.mak.dev
index 716a14ecc7..7a54426d78 100644
--- a/config.mak.dev
+++ b/config.mak.dev
@@ -1,4 +1,6 @@
+ifeq ($(filter no-error,$(DEVOPTS)),)
 CFLAGS += -Werror
+endif
 CFLAGS += -Wdeclaration-after-statement
 CFLAGS += -Wno-format-zero-length
 CFLAGS += -Wold-style-definition
-- 
2.17.0.290.gded63e768a
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 44 of 47 in “travis-ci: enable more warnings on travis linux-gcc job”
  1. travis-ci: enable more warnings on travis linux-gcc jobNguyễn Thái Ngọc Duy, Mar 3, 2018
  2. travis-ci: enable more warnings on travis linux-gcc jobNguyễn Thái Ngọc Duy, Mar 16, 2018
  3. Jeff KingMar 16, 2018
  4. Duy NguyenMar 17, 2018
  5. Lars SchneiderMar 17, 2018
  6. Duy NguyenMar 17, 2018
  7. Jeff KingMar 17, 2018
  8. Jeff KingMar 17, 2018
  9. Junio C HamanoMar 17, 2018
  10. Makefile: detect compiler and enable more warnings in DEVELOPER=1Nguyễn Thái Ngọc Duy, Mar 18, 2018
  11. Eric SunshineMar 18, 2018
  12. Duy NguyenMar 18, 2018
  13. Jeff KingMar 18, 2018
  14. Eric SunshineMar 18, 2018
  15. Jeff KingMar 18, 2018
  16. Eric SunshineMar 18, 2018
  17. Jeff KingMar 18, 2018
  18. Duy NguyenMar 18, 2018
  19. Duy NguyenMar 18, 2018
  20. Ramsay JonesMar 18, 2018
  21. Duy NguyenMar 19, 2018
  22. Jeff KingMar 20, 2018
  23. Makefile: detect compiler and enable more warnings in DEVELOPER=1Nguyễn Thái Ngọc Duy, Mar 24, 2018
  24. Eric SunshineMar 25, 2018
  25. Junio C HamanoMar 26, 2018
  26. Duy NguyenMar 27, 2018
  27. Junio C HamanoMar 27, 2018
  28. 0/3 Enable more compiler warnings for devsNguyễn Thái Ngọc Duy, Mar 29, 2018
  29. 3/3 Makefile: add EAGER_DEVELOPER modeNguyễn Thái Ngọc Duy, Mar 29, 2018
  30. 2/3 Makefile: detect compiler and enable more warnings in DEVELOPER=1Nguyễn Thái Ngọc Duy, Mar 29, 2018
  31. 1/3 connect.c: mark die_initial_contact() NORETURNNguyễn Thái Ngọc Duy, Mar 29, 2018
  32. 4/3 Makefile: untangle DEVELOPER and -WerrorÆvar Arnfjörð Bjarmason, Mar 31, 2018
  33. Duy NguyenMar 31, 2018
  34. Ævar Arnfjörð BjarmasonApr 3, 2018
  35. Duy NguyenApr 3, 2018
  36. Jeff KingApr 6, 2018
  37. Duy NguyenApr 7, 2018
  38. Ævar Arnfjörð BjarmasonApr 7, 2018
  39. Duy NguyenApr 7, 2018
  40. Ævar Arnfjörð BjarmasonApr 7, 2018
  41. 0/4 Make DEVELOPER more more flexible with DEVOPTSÆvar Arnfjörð Bjarmason, Apr 14, 2018
  42. 1/4 connect.c: mark die_initial_contact() NORETURNÆvar Arnfjörð Bjarmason, Apr 14, 2018
  43. 2/4 Makefile: detect compiler and enable more warnings in DEVELOPER=1Ævar Arnfjörð Bjarmason, Apr 14, 2018
  44. 3/4 Makefile: add a DEVOPTS to suppress -Werror under DEVELOPERÆvar Arnfjörð Bjarmason, Apr 14, 2018
  45. 4/4 Makefile: add a DEVOPTS to get all of -WextraÆvar Arnfjörð Bjarmason, Apr 14, 2018
  46. Junio C HamanoApr 16, 2018
  47. Jeff KingMar 17, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.