]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
math: Fix clang warnings for math/test-tgmath-ret.c
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 15 Mar 2022 18:33:02 +0000 (15:33 -0300)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 22 Dec 2024 09:40:33 +0000 (17:40 +0800)
clang warns that since the global variables are only used to function
calls (without being actually used), they are not needed and will
not be emitted.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
math/test-tgmath-ret.c

index 36dc132e4fa8599556d0ba7821a577a3574ea944..44b285ccffe4d6fe90a3a2577285a8467bb521be 100644 (file)
 #include <tgmath.h>
 #include <stdint.h>
 #include <stdio.h>
+#include <libc-diag.h>
 
+/* clang warns the global variables are not needed and will not be emitted.
+   However they are used on the CHECK_RET_* macros.  */
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunneeded-internal-declaration");
 static float fx;
 static double dx;
 static long double lx;
 static int rm = FP_INT_UPWARD;
 static unsigned int width = 64;
 static int errors = 0;
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void
 our_error (const char *c)