Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
string.c: test *cmp for all possible 1-character strings
The switch to -funsigned-char made a pre-existing bug on m68k more apparent. That is now fixed (by removing m68k's private strcmp(), see commit 7c08461), but we still have quite a few architectures that provide one or more of strcmp(), strncmp() and memcmp(). They probably all work fine for the cases where the input is all ASCII, and/or where the caller only wants to know about equality or not (i.e. only checks whether the return value is 0 or not). Let's check that all these implementations also behave correctly for bytes with the high bit set, and provide the correct ordering - independent of us now building with -funsigned-char, the C standard says that these *cmp functions should consider the buffers as consisting of unsigned chars. This is only intended to help find other latent bugs and can/should be ripped out again before v6.2, or perhaps moved to test_string.c in some form, but for now I think it's worth doing unconditionally. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
- Loading branch information