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

[PATCH 2/3] Makefile: avoid multiple -Wall in CFLAGS

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Sep 28, 2021, 09:10 UTC
Message-ID
<20210928091054.78895-3-carenas@gmail.com>
In-Reply-To
<20210928091054.78895-1-carenas@gmail.com>

6163f3f1a4 (config.mak.dev: add -Wall, primarily for -Wformat, to help autoconf users, 2018-10-12) adds a second -Wall in config.mak.dev to workaround the lack of one from config.mak.autogen.

Since 6d5d4b4e93 (Makefile: allow for combining DEVELOPER=1 and CFLAGS="...", 2019-02-22), that variable is set instead as part of DEVELOPER_FLAGS which won't be overriden by config.mak.autogen, so it can be safely removed from config.mak.dev if set instead in the Makefile.

This also has the advantage of separating cleanly CFLAGS which are used for building with the ones that provide with diagnostics.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 Makefile       | 3 ++-
 config.mak.dev | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 9df565f27b..963b9e7c6b 100644
--- a/Makefile
+++ b/Makefile
@@ -1200,7 +1200,8 @@ endif
 # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be
 # tweaked by config.* below as well as the command-line, both of
 # which'll override these defaults.
-CFLAGS = -g -O2 -Wall
+CFLAGS = -g -O2
+DEVELOPER_CFLAGS = -Wall
 LDFLAGS =
 CC_LD_DYNPATH = -Wl,-rpath,
 BASIC_CFLAGS = -I.
diff --git a/config.mak.dev b/config.mak.dev
index c81be62a5c..90c47d2782 100644
--- a/config.mak.dev
+++ b/config.mak.dev
@@ -6,7 +6,6 @@ ifeq ($(filter no-error,$(DEVOPTS)),)
 DEVELOPER_CFLAGS += -Werror
 SPARSE_FLAGS += -Wsparse-error
 endif
-DEVELOPER_CFLAGS += -Wall
 ifeq ($(filter no-pedantic,$(DEVOPTS)),)
 DEVELOPER_CFLAGS += -pedantic
 ifneq ($(filter clang4 gcc5,$(COMPILER_FEATURES)),)
-- 
2.33.0.955.gee03ddbf0e
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 5 of 13 in “Makefile: tighten pedantic flag”
  1. 0/3 Makefile: tighten pedantic flagCarlo Marcelo Arenas Belón, Sep 28, 2021
  2. 1/3 Makefile: restrict -Wpedantic and -Wno-pedantic-ms-format betterCarlo Marcelo Arenas Belón, Sep 28, 2021
  3. Ævar Arnfjörð BjarmasonSep 28, 2021
  4. Junio C HamanoSep 28, 2021
  5. 2/3 Makefile: avoid multiple -Wall in CFLAGSCarlo Marcelo Arenas Belón, Sep 28, 2021
  6. Ævar Arnfjörð BjarmasonSep 28, 2021
  7. Carlo ArenasSep 28, 2021
  8. Junio C HamanoSep 28, 2021
  9. Carlo ArenasSep 28, 2021
  10. Junio C HamanoSep 29, 2021
  11. 3/3 config.mak.dev: simplify compiler check for multiple compilersCarlo Marcelo Arenas Belón, Sep 28, 2021
  12. Ævar Arnfjörð BjarmasonSep 28, 2021
  13. Junio C HamanoSep 28, 2021

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.