This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
io manipulators need to be inline. Also libstdc++ as shared lib crashes on init
- To: libstdc++@sourceware.cygnus.com
- Subject: io manipulators need to be inline. Also libstdc++ as shared lib crashes on init
- From: Singh <singhki@jany.gs.com>
- Date: Tue, 10 Aug 1999 13:09:49 -0400
Hi, the IO manipulators need to be declared inline. I'm enclosing the
simple patch for this. I'm afraid I don't have CVS access else I would
check it in.
Also linking statically against the library works fine, however I
don't have this luxury. The shared library crashes while executing the
global constructors. Here is the stack trace. Looks like the lock is
NULL. I couldn't figure out which genops.c was being used, the one
from glibc or libstdc++...
BTW I am running on a Redhat 6.0 with gcc 2.95 and libstdc++-2.90.6. I
have glibc-2.1.1-6
(gdb) where
#0 __pthread_mutex_init (mutex=0x0, mutex_attr=0xbffff328) at spinlock.h:59
#1 0x4017d9bb in _IO_init (fp=0x804a770, flags=0) at genops.c:556
#2 0x40096a73 in __basic_file::__basic_file (this=0x804a770)
at ../../libstdc++-2.90.6/src/basic_file.cc:41
#3 0x400a8f5e in basic_filebuf<char, char_traits<char> >::_M_init_filebuf (this=0x4010b100)
at ../../libstdc++-2.90.6/bits/fstream.tcc:49
#4 0x400a90ee in basic_filebuf<char, char_traits<char> >::basic_filebuf (this=0x4010b100)
at ../../libstdc++-2.90.6/bits/fstream.tcc:62
#5 0x40090e8e in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535)
at ../../libstdc++-2.90.6/src/stdstreams.cc:35
#6 0x400910ad in global constructors keyed to __cfileinit ()
at ../../libstdc++-2.90.6/bits/std_ostream.h:73
#7 0x400ca0ea in __do_global_ctors_aux () at ../../gcc-2.95/gcc/cp/tinfo2.cc:300
#8 0x40089f7a in _init ()
-Kirat
--- std_iomanip.h.old Tue Aug 10 13:08:17 1999
+++ std_iomanip.h Tue Aug 10 12:17:04 1999
@@ -42,7 +42,7 @@
struct _Resetiosflags { ios_base::fmtflags _M_mask; };
- _Resetiosflags
+ inline _Resetiosflags
resetiosflags(ios_base::fmtflags __mask)
{
_Resetiosflags __x;
@@ -69,7 +69,7 @@
struct _Setiosflags { ios_base::fmtflags _M_mask; };
- _Setiosflags
+ inline _Setiosflags
setiosflags (ios_base::fmtflags __mask)
{
_Setiosflags __x;
@@ -96,7 +96,7 @@
struct _Setbase { int _M_base; };
- _Setbase
+ inline _Setbase
setbase (int __base)
{
_Setbase __x;
@@ -158,7 +158,7 @@
struct _Setprecision { int _M_n; };
- _Setprecision
+ inline _Setprecision
setprecision(int __n)
{
_Setprecision __x;
@@ -186,7 +186,7 @@
struct _Setw { int _M_n; };
_Setw
- setw(int __n)
+ inline setw(int __n)
{
_Setw __x;
__x._M_n = __n;