diff options
| author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-09-01 09:29:23 -0300 |
|---|---|---|
| committer | H.J. Lu <hjl.tools@gmail.com> | 2024-12-22 17:29:28 +0800 |
| commit | 77c1128bd35009285820a5e92aa585bb74e2a5ae (patch) | |
| tree | f8c6916372b6368c4e7f7394186bb1025c7ebc55 /stdio-common/bug5.c | |
| parent | 69c181f2b3c25d5a8149b975167d1925be881acf (diff) | |
| download | glibc-77c1128bd35009285820a5e92aa585bb74e2a5ae.tar.xz glibc-77c1128bd35009285820a5e92aa585bb74e2a5ae.zip | |
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>
Diffstat (limited to 'stdio-common/bug5.c')
| -rw-r--r-- | stdio-common/bug5.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/stdio-common/bug5.c b/stdio-common/bug5.c index dfa19aed55..c46810f94c 100644 --- a/stdio-common/bug5.c +++ b/stdio-common/bug5.c @@ -6,6 +6,7 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <libc-diag.h> #include <support/support.h> @@ -30,7 +31,12 @@ main (void) return 1; } for (i = 0; i < 1000; ++i) + /* 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"); fprintf (in, "%Zu\n", i); + DIAG_POP_NEEDS_COMMENT_CLANG; out = fopen (outname, "w"); if (out == NULL) |
