This is the mail archive of the
mailing list for the libstdc++ project.
RE: [RFC] libstdc++/9817 or "passing C++ strings to C functions"
- From: pcarlini at unitus dot it
- To: Pétur Runólfsson <peturr02 at ru dot is>
- Cc: libstdc++ at gcc dot gnu dot org, Nathan Myers <ncm at cantrip dot org>, bkoz at redhat dot com, sebor at roguewave dot com
- Date: Mon, 24 Feb 2003 11:42:26 +0100
- Subject: RE: [RFC] libstdc++/9817 or "passing C++ strings to C functions"
- References: <07D05A69A3D0C14FAEA60C3ACE8E5564028F552E@nike.hir.is>
Quoting Pétur Runólfsson <peturr02 at ru dot is>:
> This breaks the strings into chunks separated by \0 and then
> compares the chunks until it finds a pair that compares unequal,
> or one or both strings are empty. Note that strlen has to be
> called for both strings since strings of different length can
> collate equal.
Hi Petur. I like algorithmically your proposal (I didn't suggest something along
the same lines basically for lazyness ;)
However, I have a major concern: what about the similar issue we have with
collate::transform? collate::compare and collate::transform should be fixed in a
similar way, not only for general consistency sake, but also because they must
be able to work together.
Therefore, probably, if we really want to work around this essential problem in
the use of C collation functions, mine (and Martin's: thanks!) hack seems more