Add an example to clang attr doc

This commit is contained in:
Daniel Thornburgh 2025-07-16 15:19:37 -07:00
parent 46a0008948
commit f272839e84

View File

@ -9566,10 +9566,18 @@ not understand a aspect, it must summarily report that the format string has
that aspect.
The compiler reports an aspect by issing a relocation for the symbol
`<impl_name>_<aspect>``. This arranges for code and data needed to support the
``<impl_name>_<aspect>``. This arranges for code and data needed to support the
aspect of the implementation to be brought into the link to satisfy weak
references in the modular implemenation function.
For example, say ``printf`` is annotated with
``modular_format(__modular_printf, __printf, float)``. Then, a call to
``printf(var, 42)`` would be untouched. A call to ``printf("%d", 42)`` would
become a call to ``__modular_printf`` with the same arguments, as would
``printf("%f", 42.0)``. The latter would be accompanied with a strong
relocation against the symbol ``__printf_float``, which would bring floating
point support for ``printf`` into the link.
The following aspects are currently supported:
- ``float``: The call has a floating point argument