This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug c++/25649] [4.2 regression] Bogus "uninitialized" warning



------- Comment #3 from reichelt at gcc dot gnu dot org  2006-01-04 15:01 -------
Looks like the culprit is the following part of Paolo's patch:

+      operator>>(int& __n)
+      {
+       // _GLIBCXX_RESOLVE_LIB_DEFECTS
+       // 118. basic_istream uses nonexistent num_get member functions.
+       long __l;
+       _M_extract(__l);
+       if (!this->fail())
+         {
+           if (numeric_limits<int>::min() <= __l
+               && __l <= numeric_limits<int>::max())
+             __n = __l;
+           else
+             this->setstate(ios_base::failbit);
+         }
+       return *this;
+      }

We really don't set __n in all cases here.
So the warning is justified.

Paolo. Could you please have a look?


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pcarlini at suse dot de
          Component|libstdc++                   |c++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25649



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