Re: Invalid inputs FAILED (input.at:102) on Solaris

Martin Rehak <[email protected]>
Newsgroups gmane.comp.parsers.bison.bugs
Message-ID <[email protected]>
Hi Akim,

On November 20, 2020 7:01 am Akim Demaille wrote:
> Hi Martin,
> 
> Thanks for the report!
> 
>> Le 16 nov. 2020 à 16:05, Martin Rehak <[email protected]> a écrit :
> These part does not seem to the problem.  It is when bison wants
> to quote the source file that it seems to drop the \0.  Could you
> please try this?
> 
> $ printf "\0\n" > /tmp/foo.y
> $ LC_ALL=C ./src/bison -fcaret /tmp/foo.y 2>&1
> /tmp/foo.y:1.1: error: invalid character: '\0'
>     1 | 
>       | ^
> $ LC_ALL=C ./src/bison -fcaret /tmp/foo.y 2>&1 | od -ax -
> 0000000   /   t   m   p   /   f   o   o   .   y   :   1   .   1   :  sp
>            742f    706d    662f    6f6f    792e    313a    312e    203a
> 0000020   e   r   r   o   r   :  sp   i   n   v   a   l   i   d  sp   c
>            7265    6f72    3a72    6920    766e    6c61    6469    6320
> 0000040   h   a   r   a   c   t   e   r   :  sp   '   \   0   '  nl  sp
>            6168    6172    7463    7265    203a    5c27    2730    200a
> 0000060  sp  sp  sp   1  sp   |  sp nul  nl  sp  sp  sp  sp  sp  sp   |
>            2020    3120    7c20    0020    200a    2020    2020    7c20
> 0000100  sp   ^  nl
>            5e20    000a
> 0000103
> 
> As you can see in the od output, I do get the NUL byte in the quoted
> source line:
> 
> 0000060  sp  sp  sp   1  sp   |  sp ***nul***  nl  sp  sp  sp  sp  sp  sp   |
> 
> Do you have it too?

Yes, I have if I use C locales:

$ LC_ALL=C ./src/bison -fcaret /tmp/foo.y 2>&1 | xxd
00000000: 2f74 6d70 2f66 6f6f 2e79 3a31 2e31 3a20  /tmp/foo.y:1.1: 
00000010: 6572 726f 723a 2069 6e76 616c 6964 2063  error: invalid c
00000020: 6861 7261 6374 6572 3a20 275c 3027 0a20  haracter: '\0'. 
00000030: 2020 2031 207c 2000 0a20 2020 2020 207c     1 | ..      |
00000040: 205e 0a                                   ^.

And it is slightly different to what I get if I use (my default) 
en_US.UTF-8:

$ ./src/bison -fcaret /tmp/foo.y 2>&1 | xxd
00000000: 2f74 6d70 2f66 6f6f 2e79 3a31 2e31 3a20  /tmp/foo.y:1.1: 
00000010: 6572 726f 723a 2069 6e76 616c 6964 2063  error: invalid c
00000020: 6861 7261 6374 6572 3a20 e280 985c 30e2  haracter: ...\0.
00000030: 8099 0a20 2020 2031 207c 2000 0a20 2020  ...    1 | ..   
00000040: 2020 207c 205e 0a                           | ^.

But it still fails even if I use:

$ /usr/bin/env LC_ALL=C /usr/gnu/bin/make check

Any hint, please?

Thank you
-- 
m.
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.