This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
showpos bug in libstdc++
- From: "Betty Evans" <bevans at ittvis dot com>
- To: <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 26 Nov 2007 17:11:13 -0700
- Subject: showpos bug in libstdc++
I believe I have found a bug with libstdc++ but am unsure where to log
the bug on GNU. I cannot test this on other systems because of
installation privileges. I do know that other compilers/libraries like
Visual Studio and Sun Forte Developer do not exhibit the error.
Bug:
showpos will not put a plus sign before an int 0 but will put one in
front of a float 0.
Code:
#include <iostream>
using namespace std;
int main()
{
signed int i = 5;
cout << "Correct: int 5 showpos = " << showpos << i << endl;
i = 0;
cout << "Error: int 0 showpos = " << showpos << i << endl;
float d = 0.0;
cout << "Correct: float 0 showpos = " << showpos << d << endl;
return 0;
}
Build Command (generated automatically by eclipse):
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/showpos.d"
-MT"src/showpos.d" -o"src/showpos.o" "../src/showpos.cpp"
Output
Correct: int 5 showpos = +5
Error: int 0 showpos = 0
Correct: float 0 showpos = +0
Thanks
Betty Evans