[RFC v3 0/4] string: Add equality APIs

Alejandro Colomar alx@kernel.org
Wed Sep 3 10:05:41 GMT 2025


Hi!

Here's v3 of this patch set (still RFC).

I still need to add tests.  BTW, I find the existing tests for the
*cmp() APIs quite unreadable.  I'd appreciate some help, as I don't know
where to start.

I also need to check how to properly format commit messages, and check
change logs.

The changes in this v3 are:

-  Add documentation in the manual.  I don't know how to check that the
   documentation formats properly, though; I'm not used to texi
   documentation.

-  Use bool/_Bool always.  This adds a requirement that the user needs
   a compiler that provides this type.  In GCC, this means 3.0 at least
   (at least, that's what was mentioned on libc-alpha@).

See the range-diff below.


Have a lovely day!
Alex

Alejandro Colomar (4):
  cdefs: Add __bool
  string: Add streq,memeq,wcseq,wmemeq,strcaseeq[_l],wcscaseeq[_l] APIs
  manual: Document streq,memeq,wcseq,wmemeq,strcaseeq,wcscaseeq APIs
  tests-mbwc/tst_funcs.h: Fix typo

 localedata/tests-mbwc/dat_wcscmp.c |   2 +-
 manual/string.texi                 | 176 +++++++++++++++++++++++++++--
 misc/sys/cdefs.h                   |   6 +
 string/string.h                    |  21 ++++
 string/strings.h                   |  21 ++++
 wcsmbs/wchar.h                     |  42 +++++++
 6 files changed, 259 insertions(+), 9 deletions(-)

Range-diff against v2:
1:  12a7d56cff ! 1:  a921e4e1d2 cdefs: Add __bool
    @@ misc/sys/cdefs.h
      #endif
      
     +#if defined __cplusplus
    -+# define __bool   bool
    -+#elif defined __GNUC__ || defined __clang__
    -+# if __GNUC_PREREQ (3, 0)
    -+#  define __bool  _Bool
    -+# else
    -+#  define __bool  int
    -+# endif
    ++# define __bool  bool
     +#else
     +# define __bool  _Bool
     +#endif
2:  839b4c991d = 2:  c9f321b3d5 string: Add streq,memeq,wcseq,wmemeq,strcaseeq[_l],wcscaseeq[_l] APIs
-:  ---------- > 3:  ab46eb8684 manual: Document streq,memeq,wcseq,wmemeq,strcaseeq,wcscaseeq APIs
3:  c40363ebbc = 4:  1d701575a0 tests-mbwc/tst_funcs.h: Fix typo
-- 
2.50.1



More information about the Libc-alpha mailing list