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: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 May 2004 10:53:50 -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 pcarlini at suse dot de 2004-05-05 10:53 -------
> The issue as I see it is quite simple: The specification in table 37
> regarding char_traits<>::compare is clear, and it takes an
> extraodinary interpretation to conclude that string::compare
> and std::strcmp should match
Therefore, you don't think that tons of code around relies on that? And, if
a std::string and a "C" string are supposed to be so essentially different,
what is c_str() all about?
I think that the interpretation of the letter of the standard is easy, but,
at the same time, I think that, perhaps (I hope Nathan will provided soon
his opinion) this difference with "C" strings was not really intended. And
I think that the two specializations were actually meant to allow exploiting
for efficiency strcmp and wcscmp.
Are there other implementations around that actually use Table37 instead of
strcmp and wcscmp for char and wchar_t? I'm sure of one thing: the other
major implementation which often and often interworks with libstdc++-v3 doesn't.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15276