[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Macro arguments

From: Paul Smith
Subject: Re: Macro arguments
Date: Tue, 09 Aug 2022 23:54:30 -0400
User-agent: Evolution 3.44.3 (by Flathub.org)

On Tue, 2022-08-09 at 16:45 +0200, Gisle Vanem wrote:
> So does a "foo (arg1, arg2, arg3)" becomes one
> argument due to the parenthesis or something?

I agree it's strange.  I'm not sure I agree with the change proposed in
the patch in the Savannah bug: modifying the way all function arguments
are parsed is something that needs to be carefully considered, if
nothing else from a backward-compatibility standpoint.

For now, and for portability even if this change is adopted, I
recommend using variables to hide special characters, or potentially
special characters, used in make function calls:

  $ cat Makefile
  OP = (
  CP = )

  SHOW_1 = $(info $1)

  all : ; $(call SHOW_1,foo $(OP)x, y, z$(CP))

  $ make
  foo (x

I guess technically you only need to hide the open paren since the
close paren, by itself, is not special.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]