This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [RFC] libstdc++/9817 or "passing C++ strings to C functions"


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
appropriate.

Benjamin? Nathan?

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]