io manipulators need to be inline. Also libstdc++ as shared libcrashes on init

Benjamin Kosnik bkoz@cygnus.com
Tue Aug 10 11:41:00 GMT 1999


> 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++...


Can you please send source to reproduce this problem?

> --- 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; 


Thanks for this patch.

Just as an FYI, may I suggest consulting 

http://sourceware.cygnus.com/libstdc++/17_intro/contribute.html

For details on how to create a ChangeLog entry, etc.

-Benjamin



More information about the Libstdc++ mailing list