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

Re: [PATCH] Makefile: ASCII-sort += lists

From
Jeff King <peff@peff.net>
Date
Oct 8, 2020, 16:08 UTC
Message-ID
<20201008160816.GC2823778@coredump.intra.peff.net>
In-Reply-To
<nycvar.QRO.7.76.6.2010081156350.50@tvgsbejvaqbjf.bet>
On Thu, Oct 08, 2020 at 12:06:47PM +0200, Johannes Schindelin wrote:
Show 17 quoted lines
> My little script also finds this:
> 
> -- snip --
> @@ -1231,8 +1231,8 @@ space := $(empty) $(empty)
> 
>  ifdef SANITIZE
>  SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))
> -BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
>  BASIC_CFLAGS += -fno-omit-frame-pointer
> +BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
>  ifneq ($(filter undefined,$(SANITIZERS)),)
>  BASIC_CFLAGS += -DSHA1DC_FORCE_ALIGNED_ACCESS
>  endif
> -- snap --
> 
> I am not _so_ sure that we want to order `BASIC_CFLAGS`, but then, it does
> not hurt, does it?

I agree it would not be wrong to reorder here from the compiler's perspective, but:

  - the current ordering is not arbitrary; the intent was to show that
    we are enabling -fsanitize, and then follow it up with any other
    related options (first any that apply to all sanitizers, of which
    there is only one, and then any sanitizer-specific ones). The patch
    above splits that logic apart.
  - I'd worry that there are cases in which order _does_ matter to the
    compiler. I'm not sure if anything that goes in CFLAGS might
    qualify, but certainly order can matter for other parts of the
    command-line (e.g., static library order).
    So it might be setting us up for confusion later.
-Peff
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 9 in “Makefile: ASCII-sort += lists”
  1. Makefile: ASCII-sort += listsDenton Liu, Oct 8, 2020
  2. Johannes SchindelinOct 8, 2020
  3. Jeff KingOct 8, 2020
  4. Johannes SchindelinOct 9, 2020
  5. Denton LiuOct 9, 2020
  6. Johannes SchindelinOct 9, 2020
  7. Junio C HamanoOct 9, 2020
  8. Jeff KingOct 8, 2020
  9. Junio C HamanoOct 8, 2020

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.