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]

libstdc++/2272: comparison between signed and unsigned integer expressions in sstream



>Number:         2272
>Category:       libstdc++
>Synopsis:       comparison between signed and unsigned integer expressions in sstream
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 12 07:55:59 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Boris Folgmann
>Release:        libstdc++-2.96
>Organization:
>Environment:
gcc-c++-2.96-77.1 and libstdc++-2.96-77.1 RPMs on Red Hat 7.0
>Description:
The line

if(buf.size() - rpos != n) 

line 171 in /usr/include/g++-3/sstream causes a warning
comparison between signed and unsigned integer expressions
>How-To-Repeat:
A shortened version of my Timestamp member function

#include <sstream>

string Timestamp::String()
{
  ostringstream os;

  os << 1;

  return os.str();
}
>Fix:
Use signed and unsigned correctly?

>Release-Note:
>Audit-Trail:
>Unformatted:


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