|
From: | Eric Blake |
Subject: | Re: bison-generated code causes compilation failure on OpenBSD 4.7 |
Date: | Thu, 07 Oct 2010 15:36:21 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4 |
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 address@hidden +1-801-349-2682 Libvirt virtualization library http://libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |