]> Savannah Git Hosting - gnulib.git/commitdiff
xmalloca: pacify gcc -Wbad-function-cast
authorBruno Haible <bruno@clisp.org>
Sat, 24 Feb 2018 00:33:35 +0000 (01:33 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 24 Feb 2018 00:33:35 +0000 (01:33 +0100)
* lib/xmalloca.h (xmalloca): Insert intermediate cast here as well.

ChangeLog
lib/malloca.h
lib/xmalloca.h

index fcbda127183ad024f81c445727859833b52cea4e..6c51a009bab4d60cdfd989ed2d474b400bbd599b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-02-23  Bruno Haible  <bruno@clisp.org>
+
+       xmalloca: pacify gcc -Wbad-function-cast
+       * lib/xmalloca.h (xmalloca): Insert intermediate cast here as well.
+
 2018-02-23  Paul Eggert  <eggert@cs.ucla.edu>
 
        nl_langinfo: pacify gcc -Wunused-function
index 640186586960f7386ba305fc0abbdb7e94b91379..8e8f9cfd4b7e126122b0fe10a2fd8657cd074105 100644 (file)
@@ -56,10 +56,10 @@ extern "C" {
    the function returns.  Upon failure, it returns NULL.  */
 #if HAVE_ALLOCA
 # define malloca(N) \
-  ((N) < 4032 - (2 * sa_alignment_max - 1)                          \
+  ((N) < 4032 - (2 * sa_alignment_max - 1)                                   \
    ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
-                + (2 * sa_alignment_max - 1))                       \
-               & ~(uintptr_t)(2 * sa_alignment_max - 1))            \
+                + (2 * sa_alignment_max - 1))                                \
+               & ~(uintptr_t)(2 * sa_alignment_max - 1))                     \
    : mmalloca (N))
 #else
 # define malloca(N) \
index 14fc1b9dcc69a8761499db2fbff7dacb9ed907bd..2900a07b4bd8b7a42a95cb5bf0610346c0cab7f4 100644 (file)
@@ -32,10 +32,10 @@ extern "C" {
    the function returns.  Upon failure, it exits with an error message.  */
 #if HAVE_ALLOCA
 # define xmalloca(N) \
-  ((N) < 4032 - (2 * sa_alignment_max - 1)                          \
-   ? (void *) (((uintptr_t) alloca ((N) + 2 * sa_alignment_max - 1) \
-                + (2 * sa_alignment_max - 1))                       \
-               & ~(uintptr_t)(2 * sa_alignment_max - 1))            \
+  ((N) < 4032 - (2 * sa_alignment_max - 1)                                   \
+   ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
+                + (2 * sa_alignment_max - 1))                                \
+               & ~(uintptr_t)(2 * sa_alignment_max - 1))                     \
    : xmmalloca (N))
 extern void * xmmalloca (size_t n);
 #else