Re: new modules *printf-gnu

2023-03-24 Thread Bruno Haible
Paul Eggert wrote: > >* Logically, there should also be definitions of > >PRIbN PRIbLEASTN PRIbFASTN PRIbMAX PRIbPTR > > in , but I do not see them in the latest complete PDF > > https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3088.pdf > > section 7.8.1.(3). > >* Th

Re: new modules *printf-gnu

2023-03-24 Thread Paul Eggert
On 2023-03-24 17:29, Bruno Haible wrote: * Logically, there should also be definitions of PRIbN PRIbLEASTN PRIbFASTN PRIbMAX PRIbPTR in , but I do not see them in the latest complete PDF https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3088.pdf section 7.8.1.(3). * Th

Re: new modules *printf-gnu

2023-03-24 Thread Bruno Haible
Hi Eric, Thanks for the pointers. > The latest draft comments on C go a step further (warning, big document): > https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3091.doc https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3108.doc seems to be the latest one, now. > Searching that for %B finds: >

Re: RFC: add a string-desc module

2023-03-24 Thread Jeffrey Walton
On Fri, Mar 24, 2023 at 5:50 PM Bruno Haible wrote: > > In most application areas, it is not a problem if strings cannot contain NUL > bytes, and thus the C type 'char *' with its NUL terminator is well usable. > > In areas where strings with embedded NUL bytes need to be handled, the common > app

Re: RFC: add a string-desc module

2023-03-24 Thread Paul Eggert
On 2023-03-24 14:50, Bruno Haible wrote: struct { size_t nbytes; char * data; } One minor comment: use idx_t instead of size_t, for the usual reasons. Also it might be a bit more efficient to put the pointer first.

RFC: add a string-desc module

2023-03-24 Thread Bruno Haible
In most application areas, it is not a problem if strings cannot contain NUL bytes, and thus the C type 'char *' with its NUL terminator is well usable. In areas where strings with embedded NUL bytes need to be handled, the common approach is to use a 'char * data' pointer together with a 'size_t

Re: new modules *printf-gnu

2023-03-24 Thread Eric Blake
On Fri, Mar 24, 2023 at 12:37:42PM +0100, Bruno Haible wrote: > Eric Blake wrote in > : > > C23 admits that %#B is not available for > > portable use of outputting uppercase '0B...', you would have to > > manually write 0B%b inste