From e6edf5094bd304779b3dc6a7948c56e002c4286c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 15 Aug 2020 10:27:30 +0200 Subject: [PATCH] Fix "unknown pragma ignored" warnings with clang on native Windows. * lib/cbrt.c: Don't use '#pragma fenv_access (off)' with clang. * lib/cbrtf.c: Likewise. * lib/ceil.c: Likewise. * lib/floor.c: Likewise. * lib/fma.c: Likewise. * lib/fmod.c: Likewise. * lib/rint.c: Likewise. * lib/round.c: Likewise. * lib/trunc.c: Likewise. * tests/test-ceil2.c: Likewise. * tests/test-ceilf2.c: Likewise. * tests/test-floor2.c: Likewise. * tests/test-floorf2.c: Likewise. * tests/test-trunc2.c: Likewise. * tests/test-truncf2.c: Likewise. * m4/round.m4 (gl_FUNC_ROUND): Likewise. * m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise. --- ChangeLog | 21 +++++++++++++++++++++ lib/cbrt.c | 2 +- lib/cbrtf.c | 2 +- lib/ceil.c | 2 +- lib/floor.c | 2 +- lib/fma.c | 2 +- lib/fmod.c | 2 +- lib/rint.c | 2 +- lib/round.c | 2 +- lib/trunc.c | 2 +- m4/round.m4 | 4 ++-- m4/roundf.m4 | 4 ++-- tests/test-ceil2.c | 2 +- tests/test-ceilf2.c | 2 +- tests/test-floor2.c | 2 +- tests/test-floorf2.c | 2 +- tests/test-trunc2.c | 2 +- tests/test-truncf2.c | 2 +- 18 files changed, 40 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 560777abb0..d84d53fb19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2020-08-15 Bruno Haible + + Fix "unknown pragma ignored" warnings with clang on native Windows. + * lib/cbrt.c: Don't use '#pragma fenv_access (off)' with clang. + * lib/cbrtf.c: Likewise. + * lib/ceil.c: Likewise. + * lib/floor.c: Likewise. + * lib/fma.c: Likewise. + * lib/fmod.c: Likewise. + * lib/rint.c: Likewise. + * lib/round.c: Likewise. + * lib/trunc.c: Likewise. + * tests/test-ceil2.c: Likewise. + * tests/test-ceilf2.c: Likewise. + * tests/test-floor2.c: Likewise. + * tests/test-floorf2.c: Likewise. + * tests/test-trunc2.c: Likewise. + * tests/test-truncf2.c: Likewise. + * m4/round.m4 (gl_FUNC_ROUND): Likewise. + * m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise. + 2020-08-15 Bruno Haible Fix compilation errors in C++ mode with clang on native Windows. diff --git a/lib/cbrt.c b/lib/cbrt.c index 812af61316..c6834ed6e4 100644 --- a/lib/cbrt.c +++ b/lib/cbrt.c @@ -24,7 +24,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/lib/cbrtf.c b/lib/cbrtf.c index c2057bb808..727b7a864a 100644 --- a/lib/cbrtf.c +++ b/lib/cbrtf.c @@ -24,7 +24,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/lib/ceil.c b/lib/ceil.c index cf339e731c..0c33ca57fd 100644 --- a/lib/ceil.c +++ b/lib/ceil.c @@ -56,7 +56,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/lib/floor.c b/lib/floor.c index 8a2713fb9b..a735efdbfb 100644 --- a/lib/floor.c +++ b/lib/floor.c @@ -44,7 +44,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/lib/fma.c b/lib/fma.c index d14da40de8..82d1fe5983 100644 --- a/lib/fma.c +++ b/lib/fma.c @@ -69,7 +69,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/lib/fmod.c b/lib/fmod.c index 383ff71cd3..ba7e8e3b84 100644 --- a/lib/fmod.c +++ b/lib/fmod.c @@ -48,7 +48,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/lib/rint.c b/lib/rint.c index 8522fc4e94..81794d6396 100644 --- a/lib/rint.c +++ b/lib/rint.c @@ -55,7 +55,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/lib/round.c b/lib/round.c index 72809fbc28..1145032dd6 100644 --- a/lib/round.c +++ b/lib/round.c @@ -66,7 +66,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/lib/trunc.c b/lib/trunc.c index 4ef19ac36c..de45bf750b 100644 --- a/lib/trunc.c +++ b/lib/trunc.c @@ -56,7 +56,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/m4/round.m4 b/m4/round.m4 index 39c615466d..854655ce89 100644 --- a/m4/round.m4 +++ b/m4/round.m4 @@ -1,4 +1,4 @@ -# round.m4 serial 22 +# round.m4 serial 23 dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -41,7 +41,7 @@ extern "C" #endif double round (double); -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif int main() diff --git a/m4/roundf.m4 b/m4/roundf.m4 index 70a96ab87d..10f84f5446 100644 --- a/m4/roundf.m4 +++ b/m4/roundf.m4 @@ -1,4 +1,4 @@ -# roundf.m4 serial 23 +# roundf.m4 serial 24 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -41,7 +41,7 @@ extern "C" #endif float roundf (float); -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif int main() diff --git a/tests/test-ceil2.c b/tests/test-ceil2.c index 7b39bc8b20..35f75d181e 100644 --- a/tests/test-ceil2.c +++ b/tests/test-ceil2.c @@ -34,7 +34,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/tests/test-ceilf2.c b/tests/test-ceilf2.c index 7674266025..b646c6553b 100644 --- a/tests/test-ceilf2.c +++ b/tests/test-ceilf2.c @@ -34,7 +34,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/tests/test-floor2.c b/tests/test-floor2.c index be8b1a6932..3c48186d65 100644 --- a/tests/test-floor2.c +++ b/tests/test-floor2.c @@ -33,7 +33,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/tests/test-floorf2.c b/tests/test-floorf2.c index 5d6c51ffca..4c753226de 100644 --- a/tests/test-floorf2.c +++ b/tests/test-floorf2.c @@ -33,7 +33,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/tests/test-trunc2.c b/tests/test-trunc2.c index 04491f6f27..88248e9029 100644 --- a/tests/test-trunc2.c +++ b/tests/test-trunc2.c @@ -34,7 +34,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff --git a/tests/test-truncf2.c b/tests/test-truncf2.c index c33da08968..39e9c76fe3 100644 --- a/tests/test-truncf2.c +++ b/tests/test-truncf2.c @@ -34,7 +34,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif -- 2.39.5