Add an example to clang attr doc
This commit is contained in:
parent
46a0008948
commit
f272839e84
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user