On 10/07/2010 03:19 PM, Jim Meyering wrote:
Stepping back, malloc shouldn't even be declared here, since this skeleton code has already included stdlib.h.
Agreed. This portion of bison output stems back to K&R days, when you couldn't guarantee things like malloc's declaration.
But given that more than a year ago, Bison was debating about switching to generating code that assumes C89 or better[1], this is yet another argument in favor of moving in that direction - by completely dropping the malloc() declaration and instead relying on <stdlib.h> to do it's job, this problem will be trivially avoided.
[1] http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00085.html -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org