[Top][All Lists]

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

Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris

From: Eric Blake
Subject: Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12
Date: Thu, 15 Apr 2010 16:00:33 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4

On 04/15/2010 03:39 PM, Joel E. Denny wrote:
> % cat > tmp.cc
> #define __EXTENSIONS__ 1
> #include <unistd.h>
> #include <getopt.h>
> % CC -I/opt/csw/include tmp.cc
> "/opt/csw/include/getopt.h", line 122: Error: Only one of a set of overloaded 
> functions can be extern "C".
> 1 Error(s) detected.
> % CC -V
> CC: Sun C++ 5.9 SunOS_sparc Patch 124863-19 2009/12/02

This is probably a gnulib bug.  m4/getopt.m4 should reject the system
<getopt.h> if it cannot cleanly compile with the system <unistd.h> (not
a problem, because you will still have the gnulib <getopt.h> to use in
your code).

> % uname -a
> SunOS current9s 5.9 Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise-T5220

I think I still have access to a Solaris 9 machine, but am not sure if
it has /opt/csw/include, so I'm not sure how easy it will be for me to
reproduce this.  But hopefully we can come up with something.

> The trouble is that, because of the __EXTENSIONS__ definition, 
> /usr/include/unistd.h defines getopt with a different prototype than does 
> /opt/csw/include/getopt.h.

It would be helpful if you could show the getopt() declarations in both
headers, and enough context (like how __EXTENSIONS__ affects
<unistd.h>), for comparison.

> Dago is setting CPPFLAGS=-I/opt/csw/include before configuring bison, and 
> __EXTENSIONS__ is being defined in bison-

Is there anything else in /opt/csw/include that Dago really wants to
use?  Basically, gnulib's replacement getopt.h is good enough that if
you were only using it for getopt, then the solution for now of dropping
that -I should be a good enough workaround for Dago.  But if you were
using it for other files as well, then yes, gnulib should be able to
work around it.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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