Re: string-desc: Distinguish writable strings from read-only strings

2025-05-10 Thread Bruno Haible via Gnulib discussion list
Somehow I missed that this patch * produces compilation errors in the gnulib tests: ../../gltests/test-string-buffer-reversed.c:113:32: error: passing 'rw_string_desc_t' (aka 'struct rw_string_desc_t') to parameter of incompatible type 'string_desc_t' (aka 'struct string_desc_t') 113 | sb

Re: string-desc: Distinguish writable strings from read-only strings

2025-05-10 Thread Collin Funk
Bruno Haible writes: >> I have attached two patches that seem to fix the issue, but have not >> pushed them in case I am misunderstanding the error. > > While your fix is correct, I prefer to stick to the principle > "keep related things nearby together": since the attribute is about > the argume

Re: string-desc: Distinguish writable strings from read-only strings

2025-05-10 Thread Bruno Haible via Gnulib discussion list
> $ gcc --version | sed 1q > gcc (GCC) 15.1.1 20250425 (Red Hat 15.1.1-1) And the error is reproducible also with other compiler versions. gcc 13: In file included from ../../gllib/string-desc.c:20: ../config.h:1361:28: error: attributes should be specified before the declarator in a fu

Re: string-desc: Distinguish writable strings from read-only strings

2025-05-10 Thread Bruno Haible via Gnulib discussion list
Hi Collin, > However, when doing the following commands in gettext: > > $ ./autopull.sh > $ ./autogen.sh > $ ./configure && make > > I see the following error: > > $ gcc --version | sed 1q > gcc (GCC) 15.1.1 20250425 (Red Hat 15.1.1-1) > $ make > [...] > gcc -DHA

Re: string-desc: Distinguish writable strings from read-only strings

2025-05-09 Thread Collin Funk
Bruno Haible via Gnulib discussion list writes: > This patch fixes this problem, by distinguishing read-only strings and > writable strings. > > Obviously, I did not want to duplicate the functions, e.g. sd_length > to sd_length and rwsd_length. A single function should be applicable > to both re

string-desc: Distinguish writable strings from read-only strings

2025-05-09 Thread Bruno Haible via Gnulib discussion list
match the parameter type. This patch fixes this problem, by distinguishing read-only strings and writable strings. Obviously, I did not want to duplicate the functions, e.g. sd_length to sd_length and rwsd_length. A single function should be applicable to both read-only string