changeset 40036:ebff5813108e

obstack, libc-config: Support HP-UX cc in C99 mode. * lib/obstack.h (__FLEXIBLE_ARRAY_MEMBER): Treat HP-UX cc as a pre-C99 compiler, even when in C99 mode. * lib/cdefs.h (__flexarr): Likewise. * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Update comment.
author Bruno Haible <bruno@clisp.org>
date Sun, 16 Dec 2018 10:46:13 +0100
parents 364175e15699
children 01b31e00d12f
files ChangeLog lib/cdefs.h lib/gettext.h lib/obstack.h
diffstat 4 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Dec 16 07:11:44 2018 +0100
+++ b/ChangeLog	Sun Dec 16 10:46:13 2018 +0100
@@ -1,3 +1,11 @@
+2018-12-16  Bruno Haible  <bruno@clisp.org>
+
+	obstack, libc-config: Support HP-UX cc in C99 mode.
+	* lib/obstack.h (__FLEXIBLE_ARRAY_MEMBER): Treat HP-UX cc as a pre-C99
+	compiler, even when in C99 mode.
+	* lib/cdefs.h (__flexarr): Likewise.
+	* lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Update comment.
+
 2018-12-16  Bruno Haible  <bruno@clisp.org>
 
 	localename: Fix test failure on OpenBSD >= 6.2.
--- a/lib/cdefs.h	Sun Dec 16 07:11:44 2018 +0100
+++ b/lib/cdefs.h	Sun Dec 16 10:46:13 2018 +0100
@@ -139,7 +139,7 @@
    Headers that should use flexible arrays only if they're "real"
    (e.g. only if they won't affect sizeof()) should test
    #if __glibc_c99_flexarr_available.  */
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
 # define __flexarr	[]
 # define __glibc_c99_flexarr_available 1
 #elif __GNUC_PREREQ (2,97)
--- a/lib/gettext.h	Sun Dec 16 07:11:44 2018 +0100
+++ b/lib/gettext.h	Sun Dec 16 10:46:13 2018 +0100
@@ -185,7 +185,7 @@
 #include <string.h>
 
 #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
-     /* || __STDC_VERSION__ == 199901L
+     /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc)
         || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ )
 # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
 #else
--- a/lib/obstack.h	Sun Dec 16 07:11:44 2018 +0100
+++ b/lib/obstack.h	Sun Dec 16 10:46:13 2018 +0100
@@ -111,7 +111,7 @@
 #include <stddef.h>             /* For size_t and ptrdiff_t.  */
 #include <string.h>             /* For __GNU_LIBRARY__, and memcpy.  */
 
-#if __STDC_VERSION__ < 199901L
+#if __STDC_VERSION__ < 199901L || defined __HP_cc
 # define __FLEXIBLE_ARRAY_MEMBER 1
 #else
 # define __FLEXIBLE_ARRAY_MEMBER