Bruno Haible <[EMAIL PROTECTED]> writes:

> More precisely, one of the string arguments must be an ASCII string;
> the other one can also contain non-ASCII characters (but then the
> comparison result will be nonzero).

Why is this restriction needed?  Doesn't the code simply
compare bytes after converting 'A'-'Z' to 'a'-'z'?  In that case,
it is not really required that one argument must be an ASCII string;
both strings can be non-ASCII but the result is still well-defined.

>   return c1 - c2;

A nit: in theory this could result in integer overflow.
The following would be portable to machines where char == int.

   return UCHAR_MAX <= INT_MAX ? c1 - c2 : c1 < c2 ? -1 : c1 > c2;

Such machines do exist.  They are unlikely targets for big GNU
apps but are potential targets for this module.


_______________________________________________
bug-gnulib mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to