]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf: use __attribute__((__gnu_printf__)) where appropriate
authorNick Alcock <nick.alcock@oracle.com>
Tue, 3 Jun 2025 12:39:33 +0000 (13:39 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 26 Jun 2025 14:50:48 +0000 (15:50 +0100)
commit0d366df4431cd0f3e84b7f1ac3abd0291d002538
treeb3c5e325d53bfb552a3e40d38009fa7224abf1cc
parentfe282c7bb5f331f6f00759ed961e1730c007a54a
libctf: use __attribute__((__gnu_printf__)) where appropriate

We don't use any GNU-specific printf args, but this prevents warnings about
%z, observed on MinGW even though every libc anyone is likely to use there
supports %z perfectly well, and we're not stopping using it just because
MinGW complains.  Doing this means we stand more chance of seeing *actual*
problems on such platforms without them being drowned in noise.

We turn this off on clang, which doesn't support __gnu_printf__.

Suggested by Eli Zaretskii.

libctf/
PR libctf/31863
* ctf-impl.h (_libctf_printflike_): Use __gnu_printf__.
libctf/ctf-impl.h