diff options
author | Bruno Haible <bruno@clisp.org> | 2020-05-23 20:41:51 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-05-23 20:41:51 +0200 |
commit | 3cf2dc197941c8a162c338de008450a95a5bcc38 (patch) | |
tree | c6dac42a4e88a1acc1c344a38d7cddd63c94b702 | |
parent | f95e68ffaf3b2cf0725bcaa47f877fdcaae38ca8 (diff) | |
download | gnulib-3cf2dc197941c8a162c338de008450a95a5bcc38.tar.gz gnulib-3cf2dc197941c8a162c338de008450a95a5bcc38.tar.bz2 |
calloc-gnu: Avoid wrong configure results with clang.
* m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Mark the pointer variable as
'volatile', to defeat compiler optimizations.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | m4/calloc.m4 | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,11 @@ 2020-05-23 Bruno Haible <bruno@clisp.org> + calloc-gnu: Avoid wrong configure results with clang. + * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Mark the pointer variable as + 'volatile', to defeat compiler optimizations. + +2020-05-23 Bruno Haible <bruno@clisp.org> + isnanl, isnanl-nolibm: Make a test work better with "gcc -O2" on x86_64. * m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Pass the 'long double' values by reference, with values taken from a statically diff --git a/m4/calloc.m4 b/m4/calloc.m4 index 2e0d8ff03a..3361cba7a6 100644 --- a/m4/calloc.m4 +++ b/m4/calloc.m4 @@ -1,4 +1,4 @@ -# calloc.m4 serial 20 +# calloc.m4 serial 21 # Copyright (C) 2004-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -25,7 +25,7 @@ AC_DEFUN([_AC_FUNC_CALLOC_IF], [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT], [[int result = 0; - char *p = calloc (0, 0); + char * volatile p = calloc (0, 0); if (!p) result |= 1; free (p); |