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]
Other format: [Raw text]

Re: Potentially uninitialized variable warning in basic_ios.tcc



> (The same holds for the function basic_ios::narrow above that.) Was this
> intended? Since _M_check_facet returns "true" or throws a bad_cast

It's the new warning code.

>       char
>       basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
> !     { 
> !       char __ret;
+          char __ret = __dfault.

>         if (_M_check_facet(_M_ios_fctype))
> ! 	__ret = _M_ios_fctype->narrow(__c, __dfault); 
> !       return __ret;
>       }
>   
>     template<typename _CharT, typename _Traits>
>       _CharT
>       basic_ios<_CharT, _Traits>::widen(char __c) const
>       {
> !       char_type __ret;
+          char_type __ret = char_type();


This would probably be better.


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