<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.parsers.bison.bugs">
    <title>gmane.comp.parsers.bison.bugs</title>
    <link>http://blog.gmane.org/gmane.comp.parsers.bison.bugs</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3871"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3870"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3869"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3868"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3867"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3866"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3865"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3864"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3863"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3862"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3861"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3860"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3859"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3858"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3857"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3856"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3855"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3854"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3853"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3852"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3871">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3871</link>
    <description>&lt;pre&gt;
Le 21 mai 2012 à 14:36, Stefano Lattarini a écrit :


Thanks, I installed the two attached patches in "maint".



&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-21T12:50:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3870">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3870</link>
    <description>&lt;pre&gt;Yes: 'next' bootstraps, builds and passes the testsuite.

Regards,
  Stefano


&lt;/pre&gt;</description>
    <dc:creator>Stefano Lattarini</dc:creator>
    <dc:date>2012-05-21T12:36:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3869">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3869</link>
    <description>&lt;pre&gt;
Le 19 mai 2012 à 15:41, Stefano Lattarini a écrit :


Ah, indeed.  I don't consider that bootstrap's job is
to play with the submodules, but it might help indeed.

And so, back to the Flex issue, does my proposal fix
the problem?



&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-21T09:13:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3868">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3868</link>
    <description>&lt;pre&gt;I had indeed done "git clean -fdx" before re-boostrapping.

I've tried from a freshly-cloned repository; same error.

But I've now found the problem: "bootstrap" doesn't initialize the
'autoconf' submodule!  If I do that manually:

    git submodule init &amp;amp;&amp;amp; git submodule update

the bootstrap succeeds.

Regards,
  Stefano


&lt;/pre&gt;</description>
    <dc:creator>Stefano Lattarini</dc:creator>
    <dc:date>2012-05-19T13:41:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3867">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3867</link>
    <description>&lt;pre&gt;
Le 16 mai 2012 à 10:54, Stefano Lattarini a écrit :


Really, did you start from a fresh clone?  There are very nasty
issues, such as dangling symlink for *.m4 files that breaks
aclocal.  Be sure to, at least, git clean -fr.  Or just
rm -rf in your bison directory and check out again.



&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-16T09:07:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3866">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3866</link>
    <description>&lt;pre&gt;Sorry, I've been unclear; I meant: the *bootstrap* itself fails like this:


  Don't forget to
    - "include gnulib.mk" from within "lib/Makefile.am",
    - mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am,
    - mention "m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am,
    - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC_STDC,
    - invoke gl_INIT in ./configure.ac.
  running: AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install \
                                                     --no-recursive -I m4
  autoreconf2.50: Entering directory `.'
  autoreconf2.50: running: true
  autoreconf2.50: running: aclocal -I m4 -I m4
  autoreconf2.50: configure.ac: tracing
  autoreconf2.50: configure.ac: not using Libtool
  autoreconf2.50: running: /usr/bin/autoconf --include=m4
  configure.ac:122: error: possibly undefined macro: AC_PROG_GNU_M4
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
  autoreconf2.50: /usr/bin/autoconf failed with exit status: 1

Thanks,
  Stefano


&lt;/pre&gt;</description>
    <dc:creator>Stefano Lattarini</dc:creator>
    <dc:date>2012-05-16T08:54:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3865">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3865</link>
    <description>&lt;pre&gt;
Le 15 mai 2012 à 22:45, Stefano Lattarini a écrit :


No :(  That's really weird.  Could you please provide me
with one of the wrong generated scanner?  Maybe there's
something wrong in the macros that define the version?



&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-16T08:34:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3864">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3864</link>
    <description>&lt;pre&gt;OK, I've re-done the check applying the patch to the top of maint, but I
see the same exact error as before.  Any clue?

Regards,
  Stefano


&lt;/pre&gt;</description>
    <dc:creator>Stefano Lattarini</dc:creator>
    <dc:date>2012-05-15T20:45:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3863">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3863</link>
    <description>&lt;pre&gt;Le 15 mai 2012 à 18:19, Stefano Lattarini  
&amp;lt;stefano.lattarini&amp;lt; at &amp;gt;gmail.com&amp;gt; a écrit :


Next is on top of maint, and I guess you
had checked out master.  This is a case
where bootstrap behaves very badly and
you get all sorts of failures.

I should have told you this is not master,
sorry :/

&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-15T17:28:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3862">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3862</link>
    <description>&lt;pre&gt;And right after it has failed, I get:

  $ git diff
  diff --git a/m4/m4.m4 b/m4/m4.m4
  deleted file mode 120000
  index 5b176ba..0000000
  --- a/m4/m4.m4
  +++ /dev/null
  &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1 +0,0 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
  -../submodules/autoconf/m4/m4.m4
  \ No newline at end of file

Regards,
  Stefano


&lt;/pre&gt;</description>
    <dc:creator>Stefano Lattarini</dc:creator>
    <dc:date>2012-05-15T16:19:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3861">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3861</link>
    <description>&lt;pre&gt;Bootstrapping the 'next' branch fails for me with:

  Don't forget to
    - "include gnulib.mk" from within "lib/Makefile.am",
    - mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am,
    - mention "m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am,
    - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC_STDC,
    - invoke gl_INIT in ./configure.ac.
  running: AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install \
                                                     --no-recursive -I m4
  autoreconf2.50: Entering directory `.'
  autoreconf2.50: running: true
  autoreconf2.50: running: aclocal -I m4 -I m4
  autoreconf2.50: configure.ac: tracing
  autoreconf2.50: configure.ac: not using Libtool
  autoreconf2.50: running: /usr/bin/autoconf --include=m4
  configure.ac:122: error: possibly undefined macro: AC_PROG_GNU_M4
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
  autoreconf2.50: /usr/bin/autoconf failed with exit status: 1

The same happens if I apply your patch on master.  Weird.

More info that might be useful:

  $ autoconf --version
  autoconf (GNU Autoconf) 2.69
  Copyright (C) 2012 Free Software Foundation, Inc.
  License GPLv3+/Autoconf: GNU GPL version 3 or later
  &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;, &amp;lt;http://gnu.org/licenses/exceptions.html&amp;gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

  Written by David J. MacKenzie and Akim Demaille.
  ---
  Autoconf 2.50 chosen by Debian wrapper script.
  For information and tuning advice see autoconf(1).

But the same failure happens with autoconf 2.69 installed from the tarball.

Regards,
  Stefano


&lt;/pre&gt;</description>
    <dc:creator>Stefano Lattarini</dc:creator>
    <dc:date>2012-05-15T15:59:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3860">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3860</link>
    <description>&lt;pre&gt;
Le 14 mai 2012 à 23:11, Stefano Lattarini a écrit :


So I guess this is a modified 2.5.35, as I have:

int code_get_leng (void );

Great...



Could you please try the attached patch?  Also in the
branch "next" at the moment.

&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-15T09:23:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3859">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3859</link>
    <description>&lt;pre&gt;Basically, it was a version of flex built from its development branch.
But the error persists also with flex 2.5.35 (installed from a Debian
package).


From 'src/scan-code.c':

    220:typedef size_t yy_size_t;
    ...
    679:#define FLEX_PREFIX(Id) code_ ## Id
    680:#include &amp;lt;src/flex-scanner.h&amp;gt;
    ...
    789:yy_size_t code_get_leng (void );

From 'src/flex-scanner.h':

    28:int   FLEX_PREFIX (get_leng) (void);

HTH,
  Stefano


&lt;/pre&gt;</description>
    <dc:creator>Stefano Lattarini</dc:creator>
    <dc:date>2012-05-14T21:11:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3858">
    <title>Re: Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3858</link>
    <description>&lt;pre&gt;
Le 13 mai 2012 à 12:46, Stefano Lattarini a écrit :


Hi Stefano,

Thanks for the report.  As far as I know there is no
such things as Flex 2.5.36.  Where does it come from?
Could you provide me with the conflicted types?



&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-14T12:01:10</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3857">
    <title>Building bison from master fails: "conflicting types for'code_get_leng'"</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3857</link>
    <description>&lt;pre&gt;When I try to bootstrap and build bison from latest master on my Debian
system, I see this failure:

  ...
  CC       src/src_bison-reduce.o
  CC       src/src_bison-relation.o
  CC       src/src_bison-scan-code-c.o
In file included from src/scan-code-c.c:3:0:
src/scan-code.c:789:11: error: conflicting types for 'code_get_leng'
./src/flex-scanner.h:28:1: note: previous declaration of 'code_get_leng' was here
In file included from src/scan-code-c.c:3:0:
src/scan-code.c:2344:11: error: conflicting types for 'code_get_leng'
./src/flex-scanner.h:28:1: note: previous declaration of 'code_get_leng' was here
Makefile:3833: recipe for target 'src/src_bison-scan-code-c.o' failed
make[2]: *** [src/src_bison-scan-code-c.o] Error 1

Attached is the config.log.  I'm using Automake and Autoconf from master, and
flex 2.5.36.  Let me know if you need more information.

Regards,
  Stefano
&lt;/pre&gt;</description>
    <dc:creator>Stefano Lattarini</dc:creator>
    <dc:date>2012-05-13T10:46:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3856">
    <title>Re: [PATCH 2/3] maint: simplify parse-gram.y</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3856</link>
    <description>&lt;pre&gt;
Le 6 mai 2012 à 11:27, Jim Meyering a écrit :


And I guess the git rebase has restored younger mtimes
to the generated files after you modified the source one.


Why not.  I kinda like the current setting, which avoids commits
which just change minor things (say the version of the bison
version that was used) in the generated files by leaving this in
the hands of the maintainers.  So if we find a means to avoid
gratuitous commits, I'm fine with this.

Bison uses itself to compile itself, via the test wrapper in
tests/.  We could extend it to ignore such minor differences.



&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-09T08:02:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3855">
    <title>Re: [PATCH 2/3] maint: simplify parse-gram.y</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3855</link>
    <description>&lt;pre&gt;
Ahh... my bad.  I merely rebased the 2nd of those 3 commits.
I should have manually ensured that those files were regenerated.

I'm not used to having generated files under version control.
IMHO, the fact that I ran "make distcheck" (and it did not
regenerate those .[ch] files) means that there is room for
improvement.

What do you think about making "make distcheck" ensure that using
the just-built bison induces no significant change in parse-gram.c?


&lt;/pre&gt;</description>
    <dc:creator>Jim Meyering</dc:creator>
    <dc:date>2012-05-06T09:27:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3854">
    <title>Re: [PATCH 2/3] maint: simplify parse-gram.y</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3854</link>
    <description>&lt;pre&gt;
Le 6 mai 2012 à 09:31, Jim Meyering a écrit :


FTR, I have installed this.  Your regen step did not
use xmemdup0 for some reason, so the generated code
works, but breaks on the next regeneration.

From e54ec80c0c163e7a9e24fc2eee6c42a61cbe4316 Mon Sep 17 00:00:00 2001
From: Akim Demaille &amp;lt;akim&amp;lt; at &amp;gt;lrde.epita.fr&amp;gt;
Date: Sun, 6 May 2012 10:20:43 +0200
Subject: [PATCH 4/6] maint: import the xmemdup0 gnulib module.

* bootstrap.conf: Require this module.
* src/parse-gram.y: Include xmemdup0.h.
---
 bootstrap.conf   |    3 ++-
 lib/.gitignore   |    2 ++
 src/parse-gram.y |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index e1fd548..3303ef3 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -26,7 +26,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; gnulib_modules='
   quote quotearg realloc-posix
   spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
   unistd unistd-safer unlocked-io update-copyright unsetenv verify
-  warnings xalloc xalloc-die xstrndup
+  warnings
+  xalloc xalloc-die xmemdup0 xstrndup
 
   fprintf-posix printf-posix snprintf-posix sprintf-posix
   vsnprintf-posix vsprintf-posix
diff --git a/lib/.gitignore b/lib/.gitignore
index 43f2628..915a29b 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -265,3 +265,5 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 /xsize.h
 /xstrndup.c
 /xstrndup.h
+/xmemdup0.c
+/xmemdup0.h
diff --git a/src/parse-gram.y b/src/parse-gram.y
index 8d74549..eb034b0 100644
--- a/src/parse-gram.y
+++ b/src/parse-gram.y
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -32,6 +32,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "symlist.h"
 #include "scan-gram.h"
 #include "scan-code.h"
+#include "xmemdup0.h"
 
 #define YYLLOC_DEFAULT(Current, Rhs, N)  (Current) = lloc_default (Rhs, N)
 static YYLTYPE lloc_default (YYLTYPE const *, int);
&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-06T08:45:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3853">
    <title>Re: [PATCH 2/3] maint: simplify parse-gram.y</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3853</link>
    <description>&lt;pre&gt;
Precisely.


Hah!  That's even better.
It's not often that one can replace so many lines with just one.

Pushed.



&lt;/pre&gt;</description>
    <dc:creator>Jim Meyering</dc:creator>
    <dc:date>2012-05-06T07:31:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3852">
    <title>Re: [PATCH 2/3] maint: simplify parse-gram.y</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3852</link>
    <description>&lt;pre&gt;Hi Jim!

This is perfect, push whenever you want.

Le 5 mai 2012 à 15:26, Jim Meyering a écrit :


For my education, you prefer memdup to strndup because of
of the inner strnlen of the latter, right?  It makes plenty
of sense, but this split memdup + '=0' is not nice looking.
It would be cleaner to have say xmemdup0 which would add
this 0.

Actually, I just grepped xmemdup in gnulib to see if there
are many such memdup + '=0', and here is what I found:

lib/xmemdup0.c:
char *
xmemdup0 (void const *p, size_t s)
{
  char *result = xcharalloc (s + 1);
  memcpy (result, p, s);
  result[s] = 0;
  return result;
}

:)  So please, make it

    {
      char *name = xmemdup0 (name_start, strspn (name_start, alphanum));
      muscle_pair_list_grow (type, decl, name);
      free (name);
    }

(I think this is the last time I will bug you with this patch :)
but looking at the surrounding code, I see that we do not support
\n in %parse-param, which is not nice, I will make another patch
on top of yours).



&lt;/pre&gt;</description>
    <dc:creator>Akim Demaille</dc:creator>
    <dc:date>2012-05-06T06:58:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3851">
    <title>Re: [PATCH 2/3] maint: simplify parse-gram.y</title>
    <link>http://permalink.gmane.org/gmane.comp.parsers.bison.bugs/3851</link>
    <description>&lt;pre&gt;
Fixing that and applying your suggestion to use strspn in 2/2
and rebasing to maint, I get the following.  Will push later today.

From 121474cea7f26a27130f8f66b8dba8dc3e5ff52d Mon Sep 17 00:00:00 2001
From: Jim Meyering &amp;lt;meyering&amp;lt; at &amp;gt;redhat.com&amp;gt;
Date: Sat, 5 May 2012 11:30:01 +0200
Subject: [PATCH 1/2] maint: s/strncpy/memcpy/, when equivalent

* src/output.c (output_skeleton): Use memcpy, not strncpy,
since the source is known to fit in the destination buffer.
* src/parse-gram.y (%skeleton): Likewise.
---
 src/output.c     | 2 +-
 src/parse-gram.y | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/output.c b/src/output.c
index c481e14..e0d6ed3 100644
--- a/src/output.c
+++ b/src/output.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -512,7 +512,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; output_skeleton (void)
   full_skeleton = xmalloc (pkgdatadirlen + 1
    + (skeleton_size &amp;lt; sizeof m4sugar
       ? sizeof m4sugar : skeleton_size));
-  strncpy (full_skeleton, pkgdatadir, pkgdatadirlen);
+  memcpy (full_skeleton, pkgdatadir, pkgdatadirlen);
   full_skeleton[pkgdatadirlen] = '/';
   strcpy (full_skeleton + pkgdatadirlen + 1, m4sugar);
   full_m4sugar = xstrdup (full_skeleton);
diff --git a/src/parse-gram.y b/src/parse-gram.y
index 33b802e..1968e31 100644
--- a/src/parse-gram.y
+++ b/src/parse-gram.y
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -322,7 +322,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; prologue_declaration:
             xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
           if (dir_length &amp;gt; 0)
             {
-              strncpy (skeleton_build, current_file, dir_length);
+              memcpy (skeleton_build, current_file, dir_length);
               skeleton_build[dir_length++] = '/';
             }
           strcpy (skeleton_build + dir_length, skeleton_user);
--
1.7.10.1.456.g16798d0


From 799a5a0470ddac4671e90adc13bf285fef61a484 Mon Sep 17 00:00:00 2001
From: Jim Meyering &amp;lt;meyering&amp;lt; at &amp;gt;redhat.com&amp;gt;
Date: Thu, 3 May 2012 23:01:05 +0200
Subject: [PATCH 2/2] maint: simplify parse-gram.y

* src/parse-gram.y (add_param): Use xmemdup in place of xmalloc+memcpy,
and (spotted by Akim Demaille) strspn in place of an open-coded loop.
---
 src/parse-gram.y | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/parse-gram.y b/src/parse-gram.y
index 1968e31..84c32d8 100644
--- a/src/parse-gram.y
+++ b/src/parse-gram.y
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -733,16 +733,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; add_param (char const *type, char *decl, location loc)
     complain_at (loc, _("missing identifier in parameter declaration"));
   else
     {
-      char *name;
-      size_t name_len;
-
-      for (name_len = 1;
-   memchr (alphanum, name_start[name_len], sizeof alphanum);
-   name_len++)
-continue;
-
-      name = xmalloc (name_len + 1);
-      memcpy (name, name_start, name_len);
+      size_t name_len = strspn (name_start, alphanum);
+      char *name = xmemdup (name_start, name_len + 1);
       name[name_len] = '\0';
       muscle_pair_list_grow (type, decl, name);
       free (name);
--
1.7.10.1.456.g16798d0


&lt;/pre&gt;</description>
    <dc:creator>Jim Meyering</dc:creator>
    <dc:date>2012-05-05T13:26:16</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.parsers.bison.bugs">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.parsers.bison.bugs</link>
  </textinput>
</rdf:RDF>

