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

Re: [PATCH] config.mak.dev: fix typo when enabling -Wpedantic

From
Elijah Newren <newren@gmail.com>
Date
Jul 5, 2024, 21:08 UTC
Message-ID
<CABPp-BErBRQckm9HnM9xm67z65rM0oaxrJ_w3RtGqWXJ-sdZgQ@mail.gmail.com>
In-Reply-To
<cbc9446b1b0f2453b96aa9c0d89b9ec086a619bd.1720205457.git.me@ttaylorr.com>
On Fri, Jul 5, 2024 at 11:51 AM Taylor Blau <me@ttaylorr.com> wrote:
Show 48 quoted lines
>
> In ebd2e4a13a (Makefile: restrict -Wpedantic and -Wno-pedantic-ms-format
> better, 2021-09-28), we tightened our Makefile's behavior to only enable
> -Wpedantic when compiling with either gcc5/clang4 or greater as older
> compiler versions did not have support for -Wpedantic.
>
> Commit ebd2e4a13a was looking for either "gcc5" or "clang4" to appear in
> the COMPILER_FEATURES variable, combining the two "$(filter ...)"
> searches with an "$(or ...)".
>
> But ebd2e4a13a has a typo where instead of writing:
>
>     ifneq ($(or ($filter ...),$(filter ...)),)
>
> we wrote:
>
>     ifneq (($or ($filter ...),$(filter ...)),)
>
> Causing our Makefile (when invoked with DEVELOPER=1, and a sufficiently
> recent compiler version) to barf:
>
>     $ make DEVELOPER=1
>     config.mak.dev:13: extraneous text after 'ifneq' directive
>     [...]
>
> Correctly combine the results of the two "$(filter ...)" operations by
> using "$(or ...)", not "$or".
>
> Signed-off-by: Taylor Blau <me@ttaylorr.com>
> ---
>  config.mak.dev | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/config.mak.dev b/config.mak.dev
> index 1ce4c70613..5229c35484 100644
> --- a/config.mak.dev
> +++ b/config.mak.dev
> @@ -10,7 +10,7 @@ endif
>  DEVELOPER_CFLAGS += -Wall
>  ifeq ($(filter no-pedantic,$(DEVOPTS)),)
>  DEVELOPER_CFLAGS += -pedantic
> -ifneq (($or $(filter gcc5,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),)
> +ifneq ($(or $(filter gcc5,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),)
>  DEVELOPER_CFLAGS += -Wpedantic
>  ifneq ($(filter gcc10,$(COMPILER_FEATURES)),)
>  ifeq ($(uname_S),MINGW)
> --
> 2.45.2.705.gad6bdba207.dirty

Best viewed using `--color-words=.`, so you can see that it's just one parenthesis that is moving, and in particular just moves to the right one spot. (Which you already called out nicely in the commit message.) Anyway, looks good to me.

Previous: Taylor BlauNext: Jeff King
Message 2 of 6 in “config.mak.dev: fix typo when enabling -Wpedantic”
  1. config.mak.dev: fix typo when enabling -WpedanticTaylor Blau, Jul 5, 2024
  2. Elijah NewrenJul 5, 2024
  3. Jeff KingJul 6, 2024
  4. Taylor BlauJul 6, 2024
  5. Taylor BlauJul 6, 2024
  6. Jeff KingJul 6, 2024

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.