+2020-08-09 Bruno Haible <bruno@clisp.org>
+
+ Use __typeof__ with clang.
+ * m4/stdint.m4 (gl_STDINT_H): Check for SIZE_MAX also on
+ "clang -std=gnu99".
+ * lib/intprops.h (_GL_HAVE___TYPEOF__): Define to 1 also on clang.
+ * tests/test-stdint.c (verify_same_types): Enable the check also on
+ clang.
+
2020-08-09 Bruno Haible <bruno@clisp.org>
Add ability to emit user-defined warnings and errors with clang.
/* Does the __typeof__ keyword work? This could be done by
'configure', but for now it's easier to do it by hand. */
#if (2 <= __GNUC__ \
+ || (4 <= __clang_major__) \
|| (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
|| (0x5110 <= __SUNPRO_C && !__STDC__))
# define _GL_HAVE___TYPEOF__ 1
-# stdint.m4 serial 54
+# stdint.m4 serial 55
dnl Copyright (C) 2001-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,
/* Check that SIZE_MAX has the correct type, if possible. */
#if 201112 <= __STDC_VERSION__
int k = _Generic (SIZE_MAX, size_t: 0);
-#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
|| (0x5110 <= __SUNPRO_C && !__STDC__))
extern size_t k;
extern __typeof__ (SIZE_MAX) k;
#include "verify.h"
#include "intprops.h"
-#if __GNUC__ >= 2 && DO_PEDANTIC
+#if ((__GNUC__ >= 2) || (__clang_major__ >= 4)) && DO_PEDANTIC
# define verify_same_types(expr1,expr2) \
extern void _verify_func(__LINE__) (__typeof__ (expr1) *); \
extern void _verify_func(__LINE__) (__typeof__ (expr2) *);