Errors in 6.3.1 and 7.2 Syntax of Conditionals

Mikey Yosh <[email protected]> Thu, 23 Apr 2026 01:18:10 -1000
Newsgroups gmane.comp.gnu.make.bugs
Message-ID <CAL+U5tdJtdBHGdbkundQrQmXF+x03iVqswRztmSh-5Mj1RPmTA@mail.gmail.com>
--00000000000067efc506501ece6c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

*6.3.1 Substitution References* passes the literal string "var" into
patsubst instead of expanding the variable.

> A substitution reference is shorthand for the patsubst expansion function
> (see Functions for String Substitution and Analysis
> <https://www.gnu.org/software/make/manual/make.html#Text-Functions>): =E2=
=80=98$(
> var:a=3Db)=E2=80=99 is equivalent to =E2=80=98$(patsubst %a,%b,*var*)=E2=
=80=99. We provide
> substitution references as well as patsubst for compatibility with other
> implementations of make.

*7.2 Syntax of Conditionals* claims that there are four different
directives but goes on to list five of them:

> The syntax of the conditional-directive is the same whether the
> conditional is simple or complex; after an else or not. There are *four*
> different directives that test different conditions. Here is a table of
> them:
> ifeq (arg1, arg2)
> *1*ifeq 'arg1' 'arg2'
> *2*ifeq "arg1" "arg2"
> *3*ifeq "arg1" 'arg2'
> *4*ifeq 'arg1' "arg2" *5?*

--00000000000067efc506501ece6c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><p style=3D"line-height:1.5em;padding:0px;margin:1em 0px;c=
olor:rgb(0,0,0);font-family:&quot;Fira Sans&quot;,sans-serif;font-size:16px=
"><i>6.3.1 Substitution References</i>=C2=A0passes the literal string &quot=
;var&quot; into patsubst instead of expanding the variable.</p><blockquote =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex" class=3D"gmail_quote">A substitution reference is shorthand=
 for the=C2=A0<code style=3D"line-height:1.5em;font-weight:inherit">patsubs=
t</code>=C2=A0expansion function (see=C2=A0<a href=3D"https://www.gnu.org/s=
oftware/make/manual/make.html#Text-Functions" style=3D"text-decoration:none=
;outline-style:none;color:rgb(0,80,144)">Functions for String Substitution =
and Analysis</a>): =E2=80=98<samp>$(<var style=3D"font-weight:inherit">var<=
/var>:<var style=3D"font-weight:inherit">a</var>=3D<var style=3D"font-weigh=
t:inherit">b</var>)</samp>=E2=80=99 is equivalent to =E2=80=98<samp>$(patsu=
bst %<var style=3D"font-weight:inherit">a</var>,%<var style=3D"font-weight:=
inherit">b</var>,<var style=3D""><b>var</b></var>)</samp>=E2=80=99. We prov=
ide substitution references as well as=C2=A0<code style=3D"line-height:1.5e=
m;font-weight:inherit">patsubst</code>=C2=A0for compatibility with other im=
plementations of=C2=A0<code style=3D"line-height:1.5em;font-weight:inherit"=
>make</code>.</blockquote><p style=3D"line-height:1.5em;padding:0px;margin:=
1em 0px;color:rgb(0,0,0);font-family:&quot;Fira Sans&quot;,sans-serif;font-=
size:16px"><span id=3D"gmail-index-patsubst"></span></p><p style=3D"line-he=
ight:1.5em;padding:0px;margin:1em 0px;color:rgb(0,0,0);font-family:&quot;Fi=
ra Sans&quot;,sans-serif;font-size:16px"><i>7.2 Syntax of Conditionals</i> =
claims that there are four different directives but goes on to list five of=
 them:</p><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The syntax of t=
he=C2=A0<var style=3D"font-weight:inherit">conditional-directive</var>=C2=
=A0is the same whether the conditional is simple or complex; after an=C2=A0=
<code style=3D"font-weight:inherit;line-height:1.5em">else</code>=C2=A0or n=
ot. There are <b>four</b> different directives that test different conditio=
ns. Here is a table of them:<br><code style=3D"font-weight:inherit;line-hei=
ght:1.5em">ifeq (<var style=3D"font-weight:inherit">arg1</var>,=C2=A0<var s=
tyle=3D"font-weight:inherit">arg2</var>) </code><code style=3D"line-height:=
1.5em"><b>1<br></b></code><code style=3D"font-weight:inherit;line-height:1.=
5em">ifeq &#39;<var style=3D"font-weight:inherit">arg1</var>&#39; &#39;<var=
 style=3D"font-weight:inherit">arg2</var>&#39; </code><code style=3D"line-h=
eight:1.5em"><b>2<br></b></code><code style=3D"font-weight:inherit;line-hei=
ght:1.5em">ifeq &quot;<var style=3D"font-weight:inherit">arg1</var>&quot; &=
quot;<var style=3D"font-weight:inherit">arg2</var>&quot; </code><code style=
=3D"line-height:1.5em"><b>3<br></b></code><code style=3D"font-weight:inheri=
t;line-height:1.5em">ifeq &quot;<var style=3D"font-weight:inherit">arg1</va=
r>&quot; &#39;<var style=3D"font-weight:inherit">arg2</var>&#39; </code><co=
de style=3D"line-height:1.5em"><b>4<br></b></code><code style=3D"line-heigh=
t:1.5em;font-weight:inherit">ifeq &#39;<var style=3D"font-weight:inherit">a=
rg1</var>&#39; &quot;<var style=3D"font-weight:inherit">arg2</var>&quot; </=
code><code style=3D"line-height:1.5em"><b>5?</b></code></blockquote></div>

--00000000000067efc506501ece6c--