Hi Akim, Am 19.08.2021 um 10:36 schrieb Akim Demaille <[email protected]>: >> Le 19 août 2021 à 10:21, Dagobert Michelsen <[email protected]> a écrit : >>> Thanks. Neither work as I expect. It seems that \0 does not work in char >>> classes. Could you please try this also? >>> >>> perl -p -e 's{(\0|[\200\210\360\377])}{sprintf "\\x%02x", ord($1)}ge' <log >>> >out.3 >>> >>> Currently your output looks like this: >>> >>> tests/testsuite.dir/004/input.y:1.11: error: invalid null character >>> 1 | %header "\xf0\x80\x88" >>> | ^ >>> >>> the expected output should also show \x00: >>> >>> 1 | %header "\xf0\x00\x80\x88" >>> | ^ >> >> So you are assuming that a NULL byte actually in log, which is not the case: > > You are right, I somehow confused things, and log is incorrect. So it's not > the test suite which is wrong, but bison itself. > > There remains one last check to make sure it's bison the binary that is wrong: > > LC_ALL=C ./src/bison ./tests/testsuite.dir/004/input.y 2>/tmp/log > > (src/bison, not tests/bison) > > But I'm pretty sure the \x00 is still not there, and it's going to painful to > diagnose and fix :( Yet this rings some bell, I'll dive into the history to > find something similar.
Surprise! That one does contain \x00 and the above perl line works
like charm:
dam@unstable10s
[unstable10s]:/home/dam/mgar/pkg/bison/trunk/work/solaris10-sparc/build-isa-sparcv8plus/bison-3.7.90
> perl -p -e 's{(\0|[\200\210\360\377])}{sprintf "\\x%02x", ord($1)}ge' <log
./tests/testsuite.dir/004/input.y:1.11: error: invalid null character
1 | %header "\xf0\x00\x80\x88"
| ^
and also this one:
dam@unstable10s
[unstable10s]:/home/dam/mgar/pkg/bison/trunk/work/solaris10-sparc/build-isa-sparcv8plus/bison-3.7.90
> perl -p -e 's{([\000\200\210\360\377])}{sprintf "\\x%02x", ord($1)}ge' <log
./tests/testsuite.dir/004/input.y:1.11: error: invalid null character
1 | %header "\xf0\x00\x80\x88"
| ^
log
Description: Binary data
Best regards — Dago -- "You don't become great by trying to be great, you become great by wanting to do something, and then doing it so hard that you become great in the process." - xkcd #896
