]> Savannah Git Hosting - gnulib.git/commitdiff
flexmember: try to detect HP-UX 11.31 cc bug
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Mar 2017 08:37:34 +0000 (01:37 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Mar 2017 08:37:57 +0000 (01:37 -0700)
Problem reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00066.html
* m4/flexmember.m4 (AC_C_FLEXIBLE_ARRAY_MEMBER):
Attempt to detect bug in HP-UX 11.31 cc.

ChangeLog
m4/flexmember.m4

index 18437333e860616736bb6edc9e42f62ba8565b2b..34606a582b185df5eb9385c246ebb1d81c0a5495 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-03-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       flexmember: try to detect HP-UX 11.31 cc bug
+       Problem reported by Bruno Haible in:
+       http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00066.html
+       * m4/flexmember.m4 (AC_C_FLEXIBLE_ARRAY_MEMBER):
+       Attempt to detect bug in HP-UX 11.31 cc.
+
 2017-03-16  Bruno Haible  <bruno@clisp.org>
 
        stdint: Fix test compilation failure with HP-UX 11 cc.
index 35580ac27c4c36ca17c3c9ea0054fef978be8612..9d3b50d15752aaaaf5b0d75d707fbeed9239b527 100644 (file)
@@ -1,4 +1,4 @@
-# serial 4
+# serial 5
 # Check for flexible array member support.
 
 # Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
@@ -17,12 +17,15 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
           [[#include <stdlib.h>
             #include <stdio.h>
             #include <stddef.h>
-            struct s { int n; double d[]; };]],
+            struct m { struct m *next, **list; char name[]; };
+            struct s { struct s *p; struct m *m; int n; double d[]; };]],
           [[int m = getchar ();
             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->p = p;
+            p->m = NULL;
             p->d[0] = 0.0;
             return p->d != (double *) NULL;]])],
        [ac_cv_c_flexmember=yes],