bug-gnulib
[Top][All Lists]
Advanced

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

improve clang support (42)


From: Bruno Haible
Subject: improve clang support (42)
Date: Sun, 16 Aug 2020 19:12:54 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; )

clang emits several hundred "warning: division by zero is undefined" warnings
when compiling test-intprops.c. This patch fixes it.


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

        intprops: Avoid bogus "warning: division by zero is undefined" on clang.
        * lib/intprops.h (_GL__GENERIC_BOGUS): Define to 1 on clang.

diff --git a/lib/intprops.h b/lib/intprops.h
index 2ab1b6f..6ee6324 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -396,7 +396,7 @@
    For now, assume all versions of GCC-like compilers generate bogus
    warnings for _Generic.  This matters only for compilers that
    lack relevant builtins.  */
-#if __GNUC__
+#if __GNUC__ || defined __clang__
 # define _GL__GENERIC_BOGUS 1
 #else
 # define _GL__GENERIC_BOGUS 0




reply via email to

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