[09/11] Avoid warning from -Wbuiltin-declaration-mismatch
Checks
Commit Message
Avoid GCC 11 warning from -Wbuiltin-declaration-mismatch for modfl and
sincosl under MIPS o32 ABI.
Cherry-picked 056065bbe644d396a6fadd7c759f91bba1855bd6
from https://github.com/MIPS/glibc
Signed-off-by: Chao-ying Fu <cfu@mips.com>
Signed-off-by: Aleksandar Rakic <aleksandar.rakic@htecgroup.com>
---
sysdeps/ieee754/dbl-64/s_modf.c | 4 ++++
sysdeps/ieee754/dbl-64/s_sincos.c | 4 ++++
2 files changed, 8 insertions(+)
Comments
On Thu, 23 Jan 2025, Aleksandar Rakic wrote:
> Avoid GCC 11 warning from -Wbuiltin-declaration-mismatch for modfl and
> sincosl under MIPS o32 ABI.
This should not be needed. math/Makefile has
CFLAGS-s_modf.c += -fno-builtin-modfl
CFLAGS-s_sincos.c += -fno-builtin-sincosl
which are supposed to avoid such warnings. (It wouldn't surprise me if
we're missing some such -fno-builtin-* for functions not currently
supported as built-in functions in GCC, but if such built-in functions get
added in future and result in glibc build failures, we can add the
corresponding options that were previously missed - the options work fine
even when there is no such built-in function.)
@@ -23,6 +23,7 @@
#include <math_private.h>
#include <libm-alias-double.h>
#include <stdint.h>
+#include <libc-diag.h>
static const double one = 1.0;
@@ -60,5 +61,8 @@ __modf(double x, double *iptr)
}
}
#ifndef __modf
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT (11, "-Wbuiltin-declaration-mismatch");
libm_alias_double (__modf, modf)
+DIAG_POP_NEEDS_COMMENT;
#endif
@@ -23,6 +23,7 @@
#include <fenv_private.h>
#include <math-underflow.h>
#include <libm-alias-double.h>
+#include <libc-diag.h>
#ifndef SECTION
# define SECTION
@@ -106,5 +107,8 @@ __sincos (double x, double *sinx, double *cosx)
*sinx = *cosx = x / x;
}
#ifndef __sincos
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT (11, "-Wbuiltin-declaration-mismatch");
libm_alias_double (__sincos, sincos)
+DIAG_POP_NEEDS_COMMENT;
#endif