This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/15276] Erroneous Comparisons of Negative Characters
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 May 2004 17:27:06 -0000
- Subject: [Bug libstdc++/15276] Erroneous Comparisons of Negative Characters
- References: <20040504045136.15276.mckelvey@maskull.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2004-05-05 17:27 -------
Subject: Re: Erroneous Comparisons of Negative Characters
"pcarlini at suse dot de" <gcc-bugzilla@gcc.gnu.org> writes:
| > One way to solve this is to provide the generic version only when you
| > know that char is not unsigned -- in GCC, that is detectable with
| >
| > #if !defined(__CHAR_UNSIGNED__)
|
| Thanks for the suggestion, which, actually, I had already (only vaguely)
| envisaged in my mind. As you can easily imagine, I'm not super happy with this
| solution, since at run time comparing a basic_string with a basic_string, and
| a basic_string with a "C"-string will be done in a way, comparing a "C"-string
| with a "C"-string in another, inconsistent, way (for signed char type)
|
| Don't you find this rather unsatisfactory?
No, they already compare differently (hint: think of a std::string
that contains a null character).
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15276