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  <br...@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