[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new modules *printf-gnu
From: |
Bruno Haible |
Subject: |
Re: new modules *printf-gnu |
Date: |
Sat, 25 Mar 2023 01:29:14 +0100 |
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:
> FR-217
> Make %B optional
> Accepted with comment: Wording from N 3072 section 15 with editorial
> corrections
>
> so now go check N3072:
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3072.htm#make-printf-format-specifier-b-optional
>
> which states that the PRIBPTR in <inttypes.h> is now a reliable witness
> of whether %B has C23 semantics rather than other
> implementation-defined semantics.
>
> and glibc has updated their %B implementation accordingly:
> https://sourceware.org/git/?p=glibc.git;a=commit;h=2d4728e60621
The implementation could be to define a C macro or AC_SUBSTed variable in
gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B
and test it in inttypes.in.h.
But still, I don't wish to make this change to Gnulib's <inttypes.h> for the
moment, because:
* Logically, there should also be definitions of
PRIbN PRIbLEASTN PRIbFASTN PRIbMAX PRIbPTR
in <inttypes.h>, 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).
* These macros are redundant anyway:
PRIb8 "w8b"
PRIb16 "w16b"
PRIb32 "w32b"
PRIb64 "w64b"
PRIbLEAST8 "w8b"
PRIbLEAST16 "w16b"
PRIbLEAST32 "w32b"
PRIbLEAST64 "w64b"
PRIbFAST8 "wf8b"
PRIbFAST16 "wf16b"
PRIbFAST32 "wf32b"
PRIbFAST64 "wf64b"
PRIbMAX "jb"
and likewise for uppercase B.
Bruno
Re: *printf-posix: ISO C 23: Add %b directive for binary output of integers, Bruno Haible, 2023/03/22