bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

improve clang support (28)


From: Bruno Haible
Subject: improve clang support (28)
Date: Sat, 15 Aug 2020 10:29:46 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; )

With clang on Windows, I get warnings such as

  round.c:70:10: warning: unknown pragma ignored [-Wunknown-pragmas]
  # pragma fenv_access (off)
           ^
  1 warning generated.

This patch fixes them.


2020-08-15  Bruno Haible  <bruno@clisp.org>

        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.

diff --git a/lib/cbrt.c b/lib/cbrt.c
index 812af61..c6834ed 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 c2057bb..727b7a8 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 cf339e7..0c33ca5 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 8a2713f..a735efd 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 d14da40..82d1fe5 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 383ff71..ba7e8e3 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 8522fc4..81794d6 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 72809fb..1145032 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 4ef19ac..de45bf7 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 39c6154..854655c 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 70a96ab..10f84f5 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 7b39bc8..35f75d1 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 7674266..b646c65 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 be8b1a6..3c48186 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 5d6c51f..4c75322 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 04491f6..88248e9 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 c33da08..39e9c76 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
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]