diff options
| author | H.J. Lu <hjl.tools@gmail.com> | 2024-12-23 05:12:00 +0800 |
|---|---|---|
| committer | H.J. Lu <hjl.tools@gmail.com> | 2024-12-23 06:28:55 +0800 |
| commit | 0813cb584731c2df3c37bb3e3631ef37a821d599 (patch) | |
| tree | 0642c5d829e09423108cf01b07224e0a4869749a /misc | |
| parent | 309225af546609c75663637e40472b4378371078 (diff) | |
| download | glibc-0813cb584731c2df3c37bb3e3631ef37a821d599.tar.xz glibc-0813cb584731c2df3c37bb3e3631ef37a821d599.zip | |
Suppress Clang -Wimplicit-fallthrough warnings
Since Clang doesn't properly handle
/* FALLTHROUGH */
in elf/tst-align2.c nor
/* fall through */
in misc/tst-tsearch.c
tst-align2.c:100:9: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
100 | case 'A':
| ^
tst-align2.c:100:9: note: insert '__attribute__((fallthrough));' to silence this warning
100 | case 'A':
| ^
| __attribute__((fallthrough));
tst-align2.c:100:9: note: insert 'break;' to avoid fall-through
100 | case 'A':
| ^
| break;
suppress them when compiled with Clang.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'misc')
| -rw-r--r-- | misc/tst-tsearch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/misc/tst-tsearch.c b/misc/tst-tsearch.c index 2ca561dd7d..2a8f13f774 100644 --- a/misc/tst-tsearch.c +++ b/misc/tst-tsearch.c @@ -26,6 +26,7 @@ #include <search.h> #include <tst-stack-align.h> #include <support/check.h> +#include <libc-diag.h> #define SEED 0 #define BALANCED 1 @@ -286,6 +287,8 @@ mangle_tree (enum order how, enum action what, void **root, int lag) abort (); } + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (3.2, "-Wimplicit-fallthrough"); switch (what) { case build_and_del: @@ -331,6 +334,7 @@ mangle_tree (enum order how, enum action what, void **root, int lag) break; } + DIAG_POP_NEEDS_COMMENT_CLANG; } } |
