Re: Building Bison 3.7 with musl (was Re: portability issues with unicodeio)

"A. Wilcox" <[email protected]>
Newsgroups gmane.linux.lib.musl.general,gmane.comp.parsers.bison.bugs
Organization Adélie Linux
Message-ID <[email protected]>
On 29/07/2020 19:05, Rich Felker wrote:
> On Wed, Jul 29, 2020 at 06:23:19PM -0500, A. Wilcox wrote:
>> Seeing some weird behaviour here building Bison 3.7 on musl libc.
>>
>> Something seems to be "intelligent" enough to know that \u2022 is a
>> bullet character, and is replacing it with "*" instead of ".", causing
>> all the tests to fail:
>>
>> awilcox on gwyn [17] bison: LC_ALL=C /bin/printf '\u2022\n' | od -t x1
>> 0000000 2a 0a
>> 0000002
> 
> I don't think the '*' has anything to do with it being a bullet
> character. It's just the implementation-defined replacement character
> musl's iconv uses.


Ah, ok.


> I would guess the code in bison and coreutils printf is assuming the
> non-conforming glibc behavior for iconv of returning an error if a
> character from the input is not exactly representable in the output,
> rather than making replacements and returning the number of inexact
> conversions made.


Actually, it's assuming iconv will replace \u2022 with '.', and failing
because it isn't:


@@ -1,9 +1,9 @@
 State 0

-    0 $accept: . S $end
-    1 S: . 'a' A 'a'
-    2  | . 'b' A 'b'
-    3  | . 'c' c
+    0 $accept: * S $end
+    1 S: * 'a' A 'a'
+    2  | * 'b' A 'b'
+    3  | * 'c' c

     'a'  shift, and go to state 1
     'b'  shift, and go to state 2



This test gets more and more "fun" the more platforms it's ported to.

--arw

-- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
https://www.adelielinux.org
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEjNyWOYPU1SaTSMHHyynLUZIrnRQFAl8iEIQACgkQyynLUZIr
nRR7KQ//RWkKoGQ/lwMCGfmV9V+3rgdLJzC4weeTDKwjJ7HgkqMCnKs+/dB/BQVU
mYkf54MeQXzONxS3C1ejP1JC7JuKgs1MN0AeQJWpMMk7GUTzUikx23OitXQEW5v2
XosyZgTweVYD0Z9KYx42snjy514H5aBdH/2XUP7WoryeErRy+AXQCO5QjPyisW8B
ThnWgAkm2lHcoknVbqWlb115ERRLRM9OusQa+ZmakynfpJPjFyYGBcdvMLqLWHRj
YuA8n3I1Ri2dfwYhUjLuKZ1/8O+pH5vkg0LA1qWoOo+yAdc8Ko7MCy1PnZxCZ5Gf
vO5ytE5apWdxP11C/icp9kztQ9gwVSbv0CYEp1Q2Ip3TLplPRuw4P3m5zYuQw+XP
GPrLp0NexXeCi0dKwiRi/ZLTlsR+YvzY67ZRf9lPwSfUVr1Y6ssQAfgQp4GmeUeL
2nZGkLw4xb6wcqS9CQccB/FjS3ViQBJoJOJ17M0uTgDelbKntV8FH2UiwwjoRkQD
TNceCAiAdk5SC/POmRC3FhqD4iqMJtERI/DDlTTzyYusWnrF5hSiKsJWODxRQ9LY
WVECX99pDowvOxwxvRC443SnHtkyWhkte75azGqP6jqrWxIeUXnxSqCB29dB3mvQ
gxQNbwZCC1aMNCF2FBR+501nKg3u5p0N3TDFNTnZsUOjH/T/weY=
=Ge4D
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.