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

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

From
Jeff King <peff@peff.net>
Date
Jul 6, 2024, 06:31 UTC
Message-ID
<20240706063143.GE700645@coredump.intra.peff.net>
In-Reply-To
<cbc9446b1b0f2453b96aa9c0d89b9ec086a619bd.1720205457.git.me@ttaylorr.com>
On Fri, Jul 05, 2024 at 02:51:09PM -0400, Taylor Blau wrote:
Show 7 quoted lines
> But ebd2e4a13a has a typo where instead of writing:
> 
>     ifneq ($(or ($filter ...),$(filter ...)),)
> 
> we wrote:
> 
>     ifneq (($or ($filter ...),$(filter ...)),)

Good catch. Your fix is obviously the right thing. But one thing that puzzled me...

Show 9 quoted lines
> 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".

...why don't I see this error? Based on the bug, I think that we'll always pass -Wpedantic, even for old compilers (because our weird "or" will never be the empty string).

So I could understand if the symptom was then that when you have an old compiler, we feed it -Wpedantic and it complains (though the fact that nobody noticed such a behavior makes me wonder if we even care about such old compilers now?).

But why does make complain here only sometimes? Does it depend on the version of make?

-Peff
Previous: Elijah NewrenNext: Taylor Blau
Message 3 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.