bug-bison
[Top][All Lists]
Advanced

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

Re: [PATCH] use locale-indep. c_is* functions for parsing, not isspace,


From: Jim Meyering
Subject: Re: [PATCH] use locale-indep. c_is* functions for parsing, not isspace, isprint etc
Date: Sat, 01 Sep 2012 12:41:57 +0200

Akim Demaille wrote:
> Le 5 août 2012 à 13:37, Jim Meyering a écrit :
>
>> Hi Akim,
>
> Hi Jim!
>
>> On bison's master, building on Fedora 17 with gcc version 4.8.0 20120803
>> failed due to a missing declaration of isspace in parse-gram.y.
>
> Bummer :(
>
>> It's best when parsing, to avoid using isspace and the other is*
>> macros, because they use locale-dependent tables.  Do you want a
>> grammar to be accepted in one locale and rejected in another?
>> Or worse: to succeed but generate a parser with subtly different semantics?
>
> You are right, I was very naive.
>
>> There was one other use of isspace in scan-gram.l, along with
>> a use of isprint.  This switches all of them to use gnulib's
>> locale-independent c_-prefixed functions:
>
> This is much better.  Yet the error is in maint too, and I'm not
> sure there won't be a Bison 2.6.3.  Could you install it there?
> I will merge eventually.  If you don't have time or if it not
> going smoothly, please just let me know!

Hi Akim,

I applied it to the maint branch, but at least on Fedora 17,
configure there fails:

  checking for valgrind... valgrind
  checking for Java virtual machine... java
  configure: WARNING: unknown target-version 1.7, please update gt_JAVACOMP 
macro
  checking for Java compiler... no
  checking for Java virtual machine... (cached) java
  checking that generated files are newer than configure... done
  configure: creating ./config.status
  [Exit 2]

> (Shouldn't some gnulib's syntax-check apply here?  Yes, some
> isprint etc. are valid, but the warning can be disabled in that
> case.)

Good idea.  I suggest you add a rule to bison's cfg.mk,
as is done in coreutils' cfg.mk.  Then, once you're happy
with it in bison, see how much trouble it would cause in one
or two other projects and consider whether it should be in gnulib.



reply via email to

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