Regression in commit 93efdeeb on branch-4.1

Trent Tanchin <[email protected]> Sun, 26 Jul 2026 21:28:40 -0400
Newsgroups gmane.comp.gnu.m4.bugs
Message-ID <CAFoE+9AHZuhRDugJ+QRtN8nE2hd3SO-qKciTT0NYVN3=W8-Yqg@mail.gmail.com>
--00000000000012ec0806578da568
Content-Type: multipart/alternative; boundary="00000000000012ec0606578da566"

--00000000000012ec0606578da566
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello,

There appears to be a change in the way the ARG_* macros' processing works
that causes build failures in some packages that use bison with versions of
m4 starting at commit 93efdeeb.

An example on my custom linux system (loosely based on LinuxFromScratch)
building glibc-2.43 with gcc-16.1.0:
gcc /usr/src/glibc-2.43/build/intl/plural.c -c -std=3Dgnu11 -fgnu89-inline
 -g -O2 -Wall -Wwrite-strings -Wundef -Wimplicit-fallthrough
-fmerge-all-constants -frounding-math -ftrapping-math
-fstack-protector-strong -fno-common -U_FORTIFY_SOURCE -Wstrict-prototypes
-Wold-style-definition -Wfree-labels -Wmissing-parameter-name -fmath-errno
   -fPIE     -ftls-model=3Dinitial-exec     -I../include
-I/usr/src/glibc-2.43/build/intl  -I/usr/src/glibc-2.43/build
 -I../sysdeps/unix/sysv/linux/x86_64/64  -I../sysdeps/x86_64/64/nptl
 -I../sysdeps/unix/sysv/linux/x86_64/include
-I../sysdeps/unix/sysv/linux/x86_64
 -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86
 -I../sysdeps/x86/nptl  -I../sysdeps/unix/sysv/linux/wordsize-64
 -I../sysdeps/x86_64/nptl  -I../sysdeps/unix/sysv/linux/include
-I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread
 -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv
 -I../sysdeps/unix/x86_64  -I../sysdeps/unix  -I../sysdeps/posix
 -I../sysdeps/x86_64/64  -I../sysdeps/x86_64/fpu/multiarch
 -I../sysdeps/x86_64/fpu  -I../sysdeps/x86/fpu
 -I../sysdeps/x86_64/multiarch  -I../sysdeps/x86_64
 -I../sysdeps/x86/include -I../sysdeps/x86  -I../sysdeps/ieee754/float128
 -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96
 -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32
 -I../sysdeps/wordsize-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I..
-I../libio -I.  -D_LIBC_REENTRANT -include
/usr/src/glibc-2.43/build/libc-modules.h -DMODULE_NAME=3Dlibc -include
../include/libc-symbols.h  -DPIC     -DTOP_NAMESPACE=3Dglibc
-D'LOCALEDIR=3D"/usr/share/locale"' -D'LOCALE_ALIAS_PATH=3D"/usr/share/loca=
le"'
-Wno-unused-but-set-variable -Wno-implicit-fallthrough -o
/usr/src/glibc-2.43/build/intl/plural.o -MD -MP -MF
/usr/src/glibc-2.43/build/intl/plural.o.dt -MT
/usr/src/glibc-2.43/build/intl/plural.o
/usr/src/glibc-2.43/build/intl/plural.c:160:17: error: stray =E2=80=98\33=
=E2=80=99 in
program
  160 |     YYEOF =3D 0,PU<U+001B><d1><U+0015>V               /* "end of
file"  */
      |                 ^~~~~~~~
/usr/src/glibc-2.43/build/intl/plural.c:160:18: error: stray =E2=80=98\321=
=E2=80=99 in
program
  160 |     YYEOF =3D 0,PU<U+001B><d1><U+0015>V               /* "end of
file"  */
      |                         ^~~~
/usr/src/glibc-2.43/build/intl/plural.c:160:19: error: stray =E2=80=98\25=
=E2=80=99 in
program
  160 |     YYEOF =3D 0,PU<U+001B><d1><U+0015>V               /* "end of
file"  */
      |                             ^~~~~~~~
/usr/src/glibc-2.43/build/intl/plural.c:160:20: error: expected =E2=80=98,=
=E2=80=99 or =E2=80=98}=E2=80=99
before =E2=80=98V=E2=80=99
  160 |     YYEOF =3D 0,PUV               /* "end of file"  */
      |                    ^
/usr/src/glibc-2.43/build/intl/plural.c:161:21: error: stray =E2=80=98\33=
=E2=80=99 in
program
  161 |     YYerror =3D 256,PU<U+001B><d1><U+0015>V           /* error  */
      |                     ^~~~~~~~
/usr/src/glibc-2.43/build/intl/plural.c:161:22: error: stray =E2=80=98\321=
=E2=80=99 in
program
  161 |     YYerror =3D 256,PU<U+001B><d1><U+0015>V           /* error  */
      |                             ^~~~
/usr/src/glibc-2.43/build/intl/plural.c:161:23: error: stray =E2=80=98\25=
=E2=80=99 in
program
  161 |     YYerror =3D 256,PU<U+001B><d1><U+0015>V           /* error  */
      |                                 ^~~~~~~~
/usr/src/glibc-2.43/build/intl/plural.c:162:21: error: stray =E2=80=98\33=
=E2=80=99 in
program
  162 |     YYUNDEF =3D 257,PU<U+001B><d1><U+0015>V           /* "invalid
token"  */
      |                     ^~~~~~~~
/usr/src/glibc-2.43/build/intl/plural.c:162:22: error: stray =E2=80=98\321=
=E2=80=99 in
program
  162 |     YYUNDEF =3D 257,PU<U+001B><d1><U+0015>V           /* "invalid
token"  */
      |                             ^~~~
/usr/src/glibc-2.43/build/intl/plural.c:162:23: error: stray =E2=80=98\25=
=E2=80=99 in
program
  162 |     YYUNDEF =3D 257,PU<U+001B><d1><U+0015>V           /* "invalid
token"  */
      |                                 ^~~~~~~~
...

This is the build command that generates the file:
bison --yacc --no-lines --name-prefix=3D__gettext --output
/usr/src/glibc-2.43/build/intl/plural.c plural.y

This byte pattern repeats many times over throughout plural.c, and every
build produces different random bytes. Reverting 93efdeeb fixes the issue,
although format.c has been edited since that commit, so attached is a patch
file for branch-4.1 current HEAD (commit 63e4afd3) effectively reverting
it. I have tried both the latest release of bison (3.8.2) and the latest
TOT (3.8.2.75-089c). This also occurs on glibc TOT and flex TOT (although
not the latest release).
I am not sure why it does this, but hopefully this provides enough
information to fix it in a way that also incorporates the purpose of
commit 93efdeeb.

-Trent Tanchin

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

<div dir=3D"ltr"><div>Hello,=C2=A0</div><div><br></div><div>There appears t=
o be a change in the way the ARG_* macros&#39; processing works that causes=
 build failures in some packages that use bison with versions of m4 startin=
g at commit=C2=A093efdeeb.=C2=A0</div><div><br></div><div>An example on my =
custom linux system (loosely based on LinuxFromScratch) building glibc-2.43=
 with gcc-16.1.0:</div><div>gcc /usr/src/glibc-2.43/build/intl/plural.c -c =
-std=3Dgnu11 -fgnu89-inline =C2=A0-g -O2 -Wall -Wwrite-strings -Wundef -Wim=
plicit-fallthrough -fmerge-all-constants -frounding-math -ftrapping-math -f=
stack-protector-strong -fno-common -U_FORTIFY_SOURCE -Wstrict-prototypes -W=
old-style-definition -Wfree-labels -Wmissing-parameter-name -fmath-errno =
=C2=A0 =C2=A0-fPIE =C2=A0 =C2=A0 -ftls-model=3Dinitial-exec =C2=A0 =C2=A0 -=
I../include -I/usr/src/glibc-2.43/build/intl =C2=A0-I/usr/src/glibc-2.43/bu=
ild =C2=A0-I../sysdeps/unix/sysv/linux/x86_64/64 =C2=A0-I../sysdeps/x86_64/=
64/nptl =C2=A0-I../sysdeps/unix/sysv/linux/x86_64/include -I../sysdeps/unix=
/sysv/linux/x86_64 =C2=A0-I../sysdeps/unix/sysv/linux/x86/include -I../sysd=
eps/unix/sysv/linux/x86 =C2=A0-I../sysdeps/x86/nptl =C2=A0-I../sysdeps/unix=
/sysv/linux/wordsize-64 =C2=A0-I../sysdeps/x86_64/nptl =C2=A0-I../sysdeps/u=
nix/sysv/linux/include -I../sysdeps/unix/sysv/linux =C2=A0-I../sysdeps/nptl=
 =C2=A0-I../sysdeps/pthread =C2=A0-I../sysdeps/gnu =C2=A0-I../sysdeps/unix/=
inet =C2=A0-I../sysdeps/unix/sysv =C2=A0-I../sysdeps/unix/x86_64 =C2=A0-I..=
/sysdeps/unix =C2=A0-I../sysdeps/posix =C2=A0-I../sysdeps/x86_64/64 =C2=A0-=
I../sysdeps/x86_64/fpu/multiarch =C2=A0-I../sysdeps/x86_64/fpu =C2=A0-I../s=
ysdeps/x86/fpu =C2=A0-I../sysdeps/x86_64/multiarch =C2=A0-I../sysdeps/x86_6=
4 =C2=A0-I../sysdeps/x86/include -I../sysdeps/x86 =C2=A0-I../sysdeps/ieee75=
4/float128 =C2=A0-I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/=
ldbl-96 =C2=A0-I../sysdeps/ieee754/dbl-64 =C2=A0-I../sysdeps/ieee754/flt-32=
 =C2=A0-I../sysdeps/wordsize-64 =C2=A0-I../sysdeps/ieee754 =C2=A0-I../sysde=
ps/generic =C2=A0-I.. -I../libio -I. =C2=A0-D_LIBC_REENTRANT -include /usr/=
src/glibc-2.43/build/libc-modules.h -DMODULE_NAME=3Dlibc -include ../includ=
e/libc-symbols.h =C2=A0-DPIC =C2=A0 =C2=A0 -DTOP_NAMESPACE=3Dglibc -D&#39;L=
OCALEDIR=3D&quot;/usr/share/locale&quot;&#39; -D&#39;LOCALE_ALIAS_PATH=3D&q=
uot;/usr/share/locale&quot;&#39; -Wno-unused-but-set-variable -Wno-implicit=
-fallthrough -o /usr/src/glibc-2.43/build/intl/plural.o -MD -MP -MF /usr/sr=
c/glibc-2.43/build/intl/plural.o.dt -MT /usr/src/glibc-2.43/build/intl/plur=
al.o<br>/usr/src/glibc-2.43/build/intl/plural.c:160:17: error: stray =E2=80=
=98\33=E2=80=99 in program<br>=C2=A0 160 | =C2=A0 =C2=A0 YYEOF =3D 0,PU&lt;=
U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 /* &quot;end of file&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~~<br>/usr/sr=
c/glibc-2.43/build/intl/plural.c:160:18: error: stray =E2=80=98\321=E2=80=
=99 in program<br>=C2=A0 160 | =C2=A0 =C2=A0 YYEOF =3D 0,PU&lt;U+001B&gt;&l=
t;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*=
 &quot;end of file&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~<=
br>/usr/src/glibc-2.43/build/intl/plural.c:160:19: error: stray =E2=80=98\2=
5=E2=80=99 in program<br>=C2=A0 160 | =C2=A0 =C2=A0 YYEOF =3D 0,PU&lt;U+001=
B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 /* &quot;end of file&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 ^~~~~~~~<br>/usr/src/glibc-2.43/build/intl/plural.c:160:2=
0: error: expected =E2=80=98,=E2=80=99 or =E2=80=98}=E2=80=99 before =E2=80=
=98V=E2=80=99<br>=C2=A0 160 | =C2=A0 =C2=A0 YYEOF =3D 0,PUV =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* &quot;end of file&quot; =C2=A0*/<br>=
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0^<br>/usr/src/glibc-2.43/build/intl/plural.c:161:21: error=
: stray =E2=80=98\33=E2=80=99 in program<br>=C2=A0 161 | =C2=A0 =C2=A0 YYer=
ror =3D 256,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 /* error =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~~<br>/usr/src/g=
libc-2.43/build/intl/plural.c:161:22: error: stray =E2=80=98\321=E2=80=99 i=
n program<br>=C2=A0 161 | =C2=A0 =C2=A0 YYerror =3D 256,PU&lt;U+001B&gt;&lt=
;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* error =C2=A0*/=
<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~<br>/usr/src/glibc-2.=
43/build/intl/plural.c:161:23: error: stray =E2=80=98\25=E2=80=99 in progra=
m<br>=C2=A0 161 | =C2=A0 =C2=A0 YYerror =3D 256,PU&lt;U+001B&gt;&lt;d1&gt;&=
lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* error =C2=A0*/<br>=C2=
=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~~<br>/usr/s=
rc/glibc-2.43/build/intl/plural.c:162:21: error: stray =E2=80=98\33=E2=80=
=99 in program<br>=C2=A0 162 | =C2=A0 =C2=A0 YYUNDEF =3D 257,PU&lt;U+001B&g=
t;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* &quot;inv=
alid token&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~~<br>/usr/src/glibc=
-2.43/build/intl/plural.c:162:22: error: stray =E2=80=98\321=E2=80=99 in pr=
ogram<br>=C2=A0 162 | =C2=A0 =C2=A0 YYUNDEF =3D 257,PU&lt;U+001B&gt;&lt;d1&=
gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* &quot;invalid toke=
n&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~<br>=
/usr/src/glibc-2.43/build/intl/plural.c:162:23: error: stray =E2=80=98\25=
=E2=80=99 in program<br>=C2=A0 162 | =C2=A0 =C2=A0 YYUNDEF =3D 257,PU&lt;U+=
001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* &qu=
ot;invalid token&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 ^~~~~~~~<br>...</div><div><br></div><div>This is the b=
uild command that generates the file:=C2=A0</div><div>bison --yacc --no-lin=
es --name-prefix=3D__gettext --output /usr/src/glibc-2.43/build/intl/plural=
.c plural.y<br><br></div><div>This byte pattern repeats many times over thr=
oughout plural.c, and every build produces different random bytes. Revertin=
g=C2=A093efdeeb fixes the issue, although format.c has been edited since th=
at commit, so attached is a patch file for branch-4.1 current HEAD (commit=
=C2=A063e4afd3) effectively reverting it. I have tried both the latest rele=
ase of bison (3.8.2) and the latest TOT (3.8.2.75-089c). This also occurs o=
n glibc TOT and flex TOT (although not the latest release).=C2=A0</div><div=
>I am not sure why it does this, but hopefully this provides enough informa=
tion to fix it in a way that also incorporates the purpose of commit=C2=A09=
3efdeeb.=C2=A0</div><div><br></div><div>-Trent Tanchin</div></div>

--00000000000012ec0606578da566--

--00000000000012ec0806578da568
Content-Type: text/x-patch; charset="US-ASCII"; name="m4-revert-93efdeeb.patch"
Content-Disposition: attachment; filename="m4-revert-93efdeeb.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_ms2iwhhb0>
X-Attachment-Id: f_ms2iwhhb0

LS0tIG00L3NyYy9mb3JtYXQuYy5vcmlnCTIwMjYtMDctMjYgMjA6MTU6MjEuODUzMDA1NTcwIC0w
NDAwCisrKyBtNC9zcmMvZm9ybWF0LmMJMjAyNi0wNy0yNiAyMDoxNToyOC4yMjA3ODk1ODEgLTA0
MDAKQEAgLTExMywxNiArMTEzLDE2IEBACiB9CiAKICNkZWZpbmUgQVJHX0lOVChhcmdjLCBhcmd2
KSBcCi0gICgoKGFyZ2MpID09IDApID8gMCA6IFwKLSAgICgoYXJnYyktLSwgYXJnX2ludCAoVE9L
RU5fREFUQV9URVhUICgqKGFyZ3YpKyspKSkpCisgICAgICAgICgoYXJnYyA9PSAwKSA/IDAgOiBc
CisgICAgICAgICAoLS1hcmdjLCBhcmd2KyssIGFyZ19pbnQgKFRPS0VOX0RBVEFfVEVYVCAoYXJn
dlstMV0pKSkpCiAKICNkZWZpbmUgQVJHX1NUUihhcmdjLCBhcmd2KSBcCi0gICgoKGFyZ2MpID09
IDApID8gIiIgOiBcCi0gICAoKGFyZ2MpKyssIFRPS0VOX0RBVEFfVEVYVCAoKihhcmd2KSsrKSkp
CisgICAgICAgICgoYXJnYyA9PSAwKSA/ICIiIDogXAorICAgICAgICAgKC0tYXJnYywgYXJndisr
LCBUT0tFTl9EQVRBX1RFWFQgKGFyZ3ZbLTFdKSkpCiAKICNkZWZpbmUgQVJHX0RPVUJMRShhcmdj
LCBhcmd2KSBcCi0gICgoKGFyZ2MpID09IDApID8gMCA6IFwKLSAgICgoYXJnYykrKywgYXJnX2Rv
dWJsZSAoVE9LRU5fREFUQV9URVhUICgqKGFyZ3YpKyspKSkpCisgICAgICAgICgoYXJnYyA9PSAw
KSA/IDAgOiBcCisgICAgICAgICAoLS1hcmdjLCBhcmd2KyssIGFyZ19kb3VibGUgKFRPS0VOX0RB
VEFfVEVYVCAoYXJndlstMV0pKSkpCiAKIC8qIFBhcnNlIGEgd2lkdGggb3IgcHJlY2lzaW9uIGZy
b20gRk1UJ3MgcHJlZml4LgogICAgSWYgRk1UWy0xXSA9PSAnLicgdGhpcyBpcyBhIHByZWNpc2lv
biBpbnN0ZWFkIG9mIGEgd2lkdGguCg==
--00000000000012ec0806578da568--