Skip to content

Commit

Permalink
doc: update re. ISO C23 printf changes
Browse files Browse the repository at this point in the history
The new `%w99d` fixed-width modifier still needs work in `frr-format`,
which unfortunately is not as trivial as `%b` was.

Signed-off-by: David Lamparter <[email protected]>
  • Loading branch information
eqvinox committed Mar 10, 2024
1 parent f436dc0 commit 9ae4dd3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions doc/developer/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ are available:
.. note::
``printfrr()`` does not support the ``%n`` format.
``printfrr()`` does not support the ``%n`` format. It does support ISO C23
``%b``, ``%w99d`` and ``%wf99d`` additions, but the latter two are not
supported by the ``frr-format`` plugin yet, and all 3 aren't supported by
the older compilers still in use on some supported platforms.
``%b`` can be used with ``FMT_NSTD``, but ``%w99d`` and ``%wf99d`` require
work in the ``frr-format`` plugin before they are really usable.
AS-Safety
^^^^^^^^^
Expand Down Expand Up @@ -557,8 +564,9 @@ Integer formats
cause compiler warnings when used without the plugin. Use with
:c:macro:`FMT_NSTD` if necessary.

It is possible ISO C23 may introduce another format for these, possibly
``%w64d`` discussed in `JTC 1/SC 22/WG 14/N2680 <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2680.pdf>`_.
As anticipated, ISO C23 has introduced new modifiers for this, specifically
``%w64d`` (= ``%Ld``) and ``%w64u`` (= ``%Lu``). Unfortunately, these new
modifiers are not supported by ``frr-format`` yet.

.. frrfmt:: %Lu (uint64_t)

Expand Down

0 comments on commit 9ae4dd3

Please sign in to comment.