diff options
author | Andy Wingo <wingo@pobox.com> | 2017-02-15 21:41:24 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-02-15 21:41:24 +0100 |
commit | 7e641595cd9b45ce7339e21c20a8ab81af9278f6 (patch) | |
tree | 8d224f14ad2cb5dc18a8375197c651e4563ec0cd /m4/flexmember.m4 | |
parent | 69ca2bb2217303b2556b131f3995ca4f6af81234 (diff) | |
download | guile-7e641595cd9b45ce7339e21c20a8ab81af9278f6.tar.gz |
Update Gnulib to v0.1-1157-gb03f418.
Diffstat (limited to 'm4/flexmember.m4')
-rw-r--r-- | m4/flexmember.m4 | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/m4/flexmember.m4 b/m4/flexmember.m4 index baa9ff8fb..35580ac27 100644 --- a/m4/flexmember.m4 +++ b/m4/flexmember.m4 @@ -1,7 +1,7 @@ -# serial 3 +# serial 4 # Check for flexible array member support. -# Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,8 +19,10 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER], #include <stddef.h> struct s { int n; double d[]; };]], [[int m = getchar (); - struct s *p = malloc (offsetof (struct s, d) - + m * sizeof (double)); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); p->d[0] = 0.0; return p->d != (double *) NULL;]])], [ac_cv_c_flexmember=yes], |