This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/16396] ostream << volatile char* converts to ostream << bool
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jul 2004 00:08:49 -0000
- Subject: [Bug libstdc++/16396] ostream << volatile char* converts to ostream << bool
- References: <20040706232548.16396.ramsdell@mitre.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-07-07 00:08 -------
The argument to operator<< is of type 'volatile char*', which
is converted to bool in absence of a better match. Since the
pointer is non-null, the bool is 'true', which is printed as '1'.
Now, whether this conversion is correct, I don't know -- a matter
for the libstdc++ people.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |libstdc++
Summary|cout of volatile char * |ostream << volatile char*
|prints funny |converts to ostream << bool
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16396