This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Potentially uninitialized variable warning in basic_ios.tcc
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Wolfgang Bangerth <wolfgang dot bangerth at iwr dot uni-heidelberg dot de>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 7 Feb 2002 09:11:53 -0800 (PST)
- Subject: 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.