This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: error: conflicting types for '_RESTRICT_KYWD' on Solaris 10 U9


2011/11/16 Jonathan Wakely <jwakely.gcc@gmail.com>
>
> 2011/11/16 Maciej (Matchek) BliziÅski:
> > I ran into this problem recently, with gcc-4.6.1 on Solaris 10 U9:
> >
> >> ~/usr-i386/bin/gcc-4.6 --version
>
> The version number is far less useful than the output of -v, which
> tells us how you built gcc.

$ ~/usr-i386/bin/gcc-4.6 -v
Using built-in specs.
COLLECT_GCC=/home/maciej/usr-i386/bin/gcc-4.6
COLLECT_LTO_WRAPPER=/home/maciej/usr-i386/libexec/gcc/i386-pc-solaris2.9/4.6.1/lto-wrapper
Target: i386-pc-solaris2.9
Configured with:
/home/maciej/src/opencsw/pkg/gcc4/branches/ada/work/solaris9-i386/build-isa-pentium_pro/gcc-4.6.1/configure
--program-suffix=-4.6 --prefix=/home/maciej/usr-i386
--exec_prefix=/home/maciej/usr-i386 --bindir=/home/maciej/usr-i386/bin
--sbindir=/home/maciej/usr-i386/sbin
--libexecdir=/home/maciej/usr-i386/libexec
--datadir=/home/maciej/usr-i386/share
--sysconfdir=/etc/home/maciej/usr-i386
--sharedstatedir=/home/maciej/usr-i386/share
--localstatedir=/var/home/maciej/usr-i386
--libdir=/home/maciej/usr-i386/lib
--infodir=/home/maciej/usr-i386/share/info
--includedir=/home/maciej/usr-i386/include
--mandir=/home/maciej/usr-i386/share/man --with-gnu-as
--with-as=/opt/csw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld
--enable-nls --with-included-gettext --with-libiconv-prefix=/opt/csw
--with-x --with-mpfr=/opt/csw --with-gmp=/home/maciej/usr-i386
--with-ppl=/home/maciej/usr-i386 --with-cloog=/opt/csw
--enable-cloog-backend=isl --enable-java-awt=xlib --enable-libssp
--enable-objc-gc --enable-threads=posix
--enable-languages=ada,c,c++,fortran,java,objc
--with-system-zlib=/opt/csw
Thread model: posix
gcc version 4.6.1 (GCC)

> >
> > Searching on the web showed that this problem has been cropping up
> > every now and then, e.g. this post is from 2004 which contains a
> > patch:
> >
> > http://gcc.gnu.org/ml/libstdc++/2004-04/msg00154.html
>
> That looks like a different problem.
>
> Did you build GCC on Solaris 8 and install it on Solaris 10, or
> something like that?

Yes, it was built on Solaris 9, and then run on Solaris 10.

> What is on the indicated lines of iso_string.h?

Line 60 of iso_string.h is:

extern void *memcpy(void *_RESTRICT_KYWD, const void *_RESTRICT_KYWD, size_t);

I also found /usr/include/sys/feature_tests.h, which contains:

/*
 * The following macro defines a value for the ISO C99 restrict
 * keyword so that _RESTRICT_KYWD resolves to "restrict" if
 * an ISO C99 compiler is used and "" (null string) if any other
 * compiler is used. This allows for the use of single prototype
 * declarations regardless of compiler version.
 */
#if (defined(__STDC__) && defined(_STDC_C99))
#define _RESTRICT_KYWD  restrict
#else
#define _RESTRICT_KYWD
#endif

Solaris maintains backward binary compatibility, so binaries build on
version 5.N always run on 5.(N+1), but in this case the difference
lies in additional data that go with the binary.  I'll build specific
5.10 binaries then.

Maciej


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]