1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

stdio: Suppress %Z format for clang

clang does not handle %Z on print, and just suppressing
-Wformat-invalid-specifier might trigger another warning for extra
arguments (since %Z is ignored).  So suppress -Wformat-extra-args
as well.

For tst-fphex.c a heavy hammer is used since the printf is more
complex and clang throws a more generic warning.
Reviewed-by: Sam James <sam@gentoo.org>
This commit is contained in:
Adhemerval Zanella
2022-09-01 09:29:23 -03:00
committed by H.J. Lu
parent 69c181f2b3
commit 77c1128bd3
5 changed files with 35 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libc-diag.h>
#include <support/xstdio.h>
@@ -54,6 +55,11 @@ main (int argc, char **argv)
rewind (f);
(void) fputs (buf, f);
rewind (f);
/* clang do not handle %Z format. */
DIAG_PUSH_NEEDS_COMMENT_CLANG;
DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier");
DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args");
{
size_t i;
for (i = 0; i < replace_from; ++i)
@@ -101,6 +107,7 @@ main (int argc, char **argv)
lose = 1;
}
}
DIAG_POP_NEEDS_COMMENT_CLANG;
if (!lose)
{