This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: libstdc++-v3 Does Not Compile


Phil Edwards writes:
 > The 2.95.2 compiler cannot be used with any libstdc++-v3 sources more
 > recent than the 2.90.8 snapshot.  Please see
 > 
 >     http://gcc.gnu.org/libstdc++/status.html
 > 
 > for more information.  If you must use 2.95.2, you'll need to use that
 > snapshot.
 > 
 > If you can use a more recent compiler, you could (for example) build a
 > GCC 3.0 prerelease snapshot which will include libstdc++-v3 by default.
 > That will give you an idea of what the 3.0 official release will look like.

Hello All,
OK, I tried to compile libstdc++-2.90.8 with gcc-2.95.2 and I get:

c++io.cc: In method `struct __c_streampos __basic_file::seekoff(long int, _Ios_Seekdir, _Ios_Openmode = operator |((enum _Ios_Openmode)1, (enum _Ios_Openmode)2))':
c++io.cc:210: conversion from `__off64_t' to non-scalar type `__c_streampos' requested
c++io.cc: In method `struct __c_streampos __basic_file::seekpos(_G_fpos64_t, _Ios_Openmode = operator |((enum _Ios_Openmode)1, (enum _Ios_Openmode)2))':
c++io.cc:214: `struct __c_streampos' used where a `long long int' was expected
cc1plus: warnings being treated as errors
c++io.cc:214: warning: control reaches end of non-void function `__basic_file::seekpos(_G_fpos64_t, _Ios_Openmode)'
c++io.cc: In method `struct __c_streampos __basic_file::sys_seek(_G_fpos64_t, _Ios_Seekdir)':
c++io.cc:243: `struct __c_streampos' used where a `long long int' was expected
c++io.cc:243: warning: control reaches end of non-void function `__basic_file::sys_seek(_G_fpos64_t, _Ios_Seekdir)'
make[4]: *** [c++io.lo] Error 1

And I think it is related to glibc-2.2.

I found that __c_streampos is defined as the old _fpos_t:

libstdc++-v3/config/c_io_libio.h:47:  typedef _IO_fpos64_t  __c_streampos;
libstdc++-v3/config/c_io_libio.h:49:  typedef _IO_fpos_t    __c_streampos;

So I changed it with the following patch:

--- c_io_libio.h.ezz    Fri Mar  9 14:27:22 2001
+++ c_io_libio.h        Fri Mar  9 14:28:39 2001
@@ -44,9 +44,9 @@
   typedef _IO_ssize_t  wstreamsize;
 #endif
 #if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-  typedef _IO_fpos64_t  __c_streampos;
+  typedef _IO_off64_t  __c_streampos;
 #else
-  typedef _IO_fpos_t    __c_streampos;
+  typedef _IO_off_t    __c_streampos;
 #endif

   typedef _IO_lock_t   __c_lock;

So the compiler does not complain about the __c_streampos
anymore. However, now I get the errors below. I will get the 2001-01-22
GCC 3.0 snapshot and try to compile. Please help me find some reliable
environment for compiling some ported code that uses STL with name
spaces.

-Ezz

cc1plus: warnings being treated as errors
/EZZ/gcc-2.95.2/libstdc++/bits/string.tcc: In method `std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &, unsigned int, unsigned int = std::basic_string<_CharT,_Traits,_Alloc>::npos)':
/EZZ/gcc-2.95.2/libstdc++/src/string-inst.cc:64:   instantiated from here
/EZZ/gcc-2.95.2/libstdc++/bits/basic_string.h:712: warning: can't inline call to `static char * std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_S_construct<std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >(std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >, std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >, const std::allocator<char> &)'
/EZZ/gcc-2.95.2/libstdc++/bits/string.tcc:184: warning: called from here
/EZZ/gcc-2.95.2/libstdc++/bits/basic_string.h: In method `class std::basic_string<char,std::char_traits<char>,std::allocator<char> > & std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &)':
/EZZ/gcc-2.95.2/libstdc++/bits/basic_string.h:451:   instantiated from `std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator +=(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &)'
/EZZ/gcc-2.95.2/libstdc++/src/string-inst.cc:64:   instantiated from here
/EZZ/gcc-2.95.2/libstdc++/bits/basic_string.h:675: warning: can't inline call to `class std::basic_string<char,std::char_traits<char>,std::allocator<char> > & std::basic_string<char,std::char_traits<char>,std::allocator<char> >::replace<std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >(std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >, std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >, std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >, std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >)'
/EZZ/gcc-2.95.2/libstdc++/bits/basic_string.h:470: warning: called from here
/EZZ/gcc-2.95.2/libstdc++/bits/basic_string.h: In method `class std::basic_string<char,std::char_traits<char>,std::allocator<char> > & std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &, unsigned int, unsigned int)':
/EZZ/gcc-2.95.2/libstdc++/src/string-inst.cc:64:   instantiated from here
/EZZ/gcc-2.95.2/libstdc++/bits/basic_string.h:541: warning: can't inline call to `class std::basic_string<char,std::char_traits<char>,std::allocator<char> > & std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign<std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >(std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >, std::__normal_iterator<char *,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >)'
/EZZ/gcc-2.95.2/libstdc++/bits/basic_string.h:523: warning: called from here
rm -f .libs/stringNEPS.lo
/EZZ/gcc.obj/gcc/xgcc -B/EZZ/gcc.obj/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -DHAVE_CONFIG_H -I. -I/EZZ/gcc-2.95.2/libstdc++/src -I.. -nostdinc++ -I/EZZ/gcc-2.95.2/libstdc++ -I/EZZ/gcc-2.95.2/libstdc++/stl -I/EZZ/gcc-2.95.2/libstdc++/libio -I/EZZ/gcc-2.95.2/libstdc++/config/cpu/i386 -I/EZZ/gcc-2.95.2/libstdc++/config/gnu-linux -I/usr/include -D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winline -Werror -g -fhonor-std -g -O2 -fvtable-thunks -D_GNU_SOURCE -c  -fPIC -DPIC /EZZ/gcc-2.95.2/libstdc++/src/stringNEPS.cc -o .libs/stringNEPS.lo
make[4]: *** [stringMAIN.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
/EZZ/gcc.obj/gcc/xgcc -B/EZZ/gcc.obj/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -DHAVE_CONFIG_H -I. -I/EZZ/gcc-2.95.2/libstdc++/src -I.. -nostdinc++ -I/EZZ/gcc-2.95.2/libstdc++ -I/EZZ/gcc-2.95.2/libstdc++/stl -I/EZZ/gcc-2.95.2/libstdc++/libio -I/EZZ/gcc-2.95.2/libstdc++/config/cpu/i386 -I/EZZ/gcc-2.95.2/libstdc++/config/gnu-linux -I/usr/include -D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winline -Werror -g -fhonor-std -g -O2 -fvtable-thunks -D_GNU_SOURCE -c /EZZ/gcc-2.95.2/libstdc++/src/stringNEPS.cc -o stringNEPS.o >/dev/null 2>&1
mv -f .libs/stringNEPS.lo stringNEPS.lo
mv -f .libs/misc-inst.lo misc-inst.lo
make[4]: Leaving directory `/EZZ/gcc.obj/i686-pc-linux-gnu/libstdc++/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/EZZ/gcc.obj/i686-pc-linux-gnu/libstdc++'
make[2]: *** [all-recursive-am] Error 2
make[2]: Leaving directory `/EZZ/gcc.obj/i686-pc-linux-gnu/libstdc++'
make[1]: *** [all-target-libstdc++] Error 2
make[1]: Leaving directory `/EZZ/gcc.obj'
make: *** [bootstrap] Error 2



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