mirror_zfs/include/os/freebsd
Dimitry Andric 6a9d7820e6 Rename several printf attributes declarations to __printf__
For kernel builds on FreeBSD, we redefine `__printf__` to
`__freebsd_kprintf__`, to support FreeBSD kernel printf(9) extensions
with clang.

In OpenZFS various printf related functions are declared with
`__attribute__((format(printf, X, Y)))`, so these won't work with the
above redefinition. With clang 21 and higher, this leads to errors
similar to:

    sys/contrib/openzfs/module/zfs/spa_misc.c:414:38: error: passing
    'printf' format string where 'freebsd_kprintf' format string is
    expected [-Werror,-Wformat]
      414 |         (void) vsnprintf(buf, sizeof (buf), fmt, adx);
          |                                             ^

Since attribute names can always be spelled with leading and trailing
double underscores, rename these instances.

Note that in the FreeBSD base system we usually use `__printflike` from
`<sys/cdefs.h>`, but that does not apply to OpenZFS.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Dimitry Andric <dimitry@andric.com>
Closes #18095
2026-02-05 13:48:31 -08:00
..
linux SPDX: license tags: BSD-2-Clause 2025-03-13 17:56:46 -07:00
spl Rename several printf attributes declarations to __printf__ 2026-02-05 13:48:31 -08:00
zfs/sys Add default user/group/project quota properties 2025-04-03 10:35:22 -07:00
Makefile.am mod.h: make consistent across all three platforms 2025-07-15 15:46:14 -07:00