I'm adding bug-gnulib because this portability problem is larger than bison.
On Mon, 12 Apr 2010, Dagobert Michelsen wrote: > > Can you become jdenny on current9s and determine the exact commands that > > are necessary to build Bison with these failures? That would save me a > > lot of time. Thanks. > > Sure. Please try > ~jdenny/dam/docompile Thanks. That helped. I can reproduce the problem independently of bison as follows: % 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 % uname -a SunOS current9s 5.9 Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise-T5220 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. Dago is setting CPPFLAGS=-I/opt/csw/include before configuring bison, and __EXTENSIONS__ is being defined in bison-2.4.2.8-cb76/lib/config.h. Dago then encounters the above error when running the bison test suite. Should Dago change his CPPFLAGS? Should gnulib be extended to handle this case? Or does gnulib already, but bison is not using gnulib correctly? The bison tarball we're testing is at: http://alpha.gnu.org/gnu/bison/bison-2.4.2.8-cb76.tar.gz I'll remove it after this issue is settled. Thanks.