bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Akim Demaille
Subject: Re: Invalid inputs FAILED (input.at:102) on Solaris
Date: Wed, 25 Nov 2020 08:00:52 +0100

Hi Martin,

> Le 24 nov. 2020 à 11:35, Martin Rehak <martin.rehak@oracle.com> a écrit :
> 
> Hi Akim,
> 
>> 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                                   ^.

Yes, I can see it, it seems correct.


> And it is slightly different to what I get if I use (my default) 
> en_US.UTF-8:[...]
> But it still fails even if I use:
> 
> $ /usr/bin/env LC_ALL=C /usr/gnu/bin/make check
> 
> Any hint, please?

The test suite runs with LC_ALL=C already, this is not needed.

So it may well be that the problem is actually the perl snippet I
used to "reveal" the invalid characters.  Please try this:

$ printf "\0\n" > /tmp/foo.y
$ LC_ALL=C ./src/bison -fcaret /tmp/foo.y >/tmp/foo.log 2>&1
$ perl -p -e 's{([\0\377])}{sprintf "\\x%02x", ord($1)}ge' /tmp/foo.log
/tmp/foo.y:1.1: error: invalid character: '\0'
    1 | \x00
      | ^


Cheers!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]