ialloc: Add comments

2023-03-27 Thread Bruno Haible
For the string-desc module, I need to make use of the 'ialloc' module. Which is hard if its functions are not documented. I mean, as a user of imalloc(), I'm not supposed to look into the module description in order to understand that this function returns non-NULL for a zero-sized allocation. Thin

Re: _Noreturn and draft C23

2023-03-27 Thread Bruno Haible
Hi Paul, > That reminds me, we're in a sticky situation about _Noreturn for another > reason. > > Draft C23 requires [[noreturn]] before "extern" and states that > _Noreturn is obsolescent. It's plausible that a future C version will > drop the requirement to support the _Noreturn keyword. If

_Noreturn and draft C23

2023-03-27 Thread Paul Eggert
That reminds me, we're in a sticky situation about _Noreturn for another reason. Draft C23 requires [[noreturn]] before "extern" and states that _Noreturn is obsolescent. It's plausible that a future C version will drop the requirement to support the _Noreturn keyword. If that happens, "#defi

Re: Support FALLTHROUGH macro better in glibc+clang

2023-03-27 Thread Bruno Haible
Paul Eggert wrote: > On 2023-03-25 14:24, Paul Eggert wrote: > > # if __GNUC_PREREQ (7,0) || __glibc_has_attribute (__fallthrough__) > > Come to think of it this could be simplified further, to just: > ># if __glibc_has_attribute (__fallthrough__) > > since GCC started supporting __has_a

Re: m4 porting to z/OS - gnulib fix - obstack.h

2023-03-27 Thread Bruno Haible
Hello Harithamma, Harithamma D wrote: > I am porting m4 to z/OS and came across following compilation error related > to gnulib: > > In file included from ./builtin.c:25: > In file included from ./m4.h:50: > ../lib/obstack.h:229:8: error: unknown attribute '_Noreturn' ignored > [-Werror,-Wunkno

m4 porting to z/OS - gnulib fix - obstack.h

2023-03-27 Thread Harithamma D
Hi Team, I am porting m4 to z/OS and came across following compilation error related to gnulib: In file included from ./builtin.c:25: In file included from ./m4.h:50: ../lib/obstack.h:229:8: error: unknown attribute '_Noreturn' ignored [-Werror,-Wunknown-attributes] extern __attribute_noreturn_

wcsstr: Ensure worst-case linear execution time

2023-03-27 Thread Bruno Haible
The same two-way algorithm that provides worst-case linear execution time for strstr() and memmem() also provides worst-case linear execution time for wcsstr(). Only the "shift table" optimization that Eric Blake added into it

Add test case from a past musl libc bug

2023-03-27 Thread Bruno Haible
There was a bug in the 'strstr' in musl libc, fixed in 2014. I'm adding the test case to the test suite here, just in case someone copied the old musl libc code and is still using it somewhere. 2023-03-27 Bruno Haible Add test case from a past musl libc bug. * tests/test-strst

uchar: ISO C 23: Define char8_t

2023-03-27 Thread Bruno Haible
ISO C 23 specifies a new type, to be defined by . This patch adds it. 2023-03-27 Bruno Haible uchar: ISO C 23: Define char8_t. * lib/uchar.in.h (char8_t): New type or macro. * m4/uchar_h.m4 (gl_TYPE_CHAR8_T): New macro. (gl_UCHAR_H): Invoke it. Set CXX_HAS_CHA

Re: RFC: add a string-desc module

2023-03-27 Thread Simon Josefsson via Gnulib discussion list
Bruno Haible writes: > struct > { > size_t nbytes; > char * data; > } > > I propose to add a module that adds such a type, together with elementary > functions that work on them. I think this is a useful contribution, however I see two deal-breakers for having it in gnulib -- both