Bruno Haible wrote:

I have access to such a machine now.

Excellent! Thanks.

  - The version numeber does not include a leading 0.

Yes, that seems to be the practice now. Perhaps older versions had a leading 0 before they discovered that meant it was octal.

I suggest to add a similar #elif for HP-UX ia64 cc.

Thanks, I installed the attached.
From 92869ecabac197e41976d4c7785dd82d85165e0f Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Sun, 19 Mar 2017 09:34:23 -0700
Subject: [PATCH] stdalign: tweak version# and test for HP-UX IA64

Problems reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00078.html
* lib/stdalign.in.h (_Alignas):
* m4/stdalign.m4 (gl_STDALIGN_H):
Use octal, not decimal, for __HP_cc version.  Perhaps HP formerly
used octal (as that is how they document it), but it is decimal in
practice now and the ancient implementations no longer matter.
* tests/test-stdalign.c (main) [__HP_cc && __ia64]: Skip test.
---
 ChangeLog             | 12 ++++++++++++
 lib/stdalign.in.h     |  2 +-
 m4/stdalign.m4        |  2 +-
 tests/test-stdalign.c |  5 +++++
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ee9e0d3..ac21253 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-03-19  Paul Eggert  <[email protected]>
+
+	stdalign: tweak version# and test for HP-UX IA64
+	Problems reported by Bruno Haible in:
+	http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00078.html
+	* lib/stdalign.in.h (_Alignas):
+	* m4/stdalign.m4 (gl_STDALIGN_H):
+	Use octal, not decimal, for __HP_cc version.  Perhaps HP formerly
+	used octal (as that is how they document it), but it is decimal in
+	practice now and the ancient implementations no longer matter.
+	* tests/test-stdalign.c (main) [__HP_cc && __ia64]: Skip test.
+
 2017-03-19  Bruno Haible  <[email protected]>
 
 	vma-iter: Add support for Solaris.
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
index 1b6d8cb..21f4947 100644
--- a/lib/stdalign.in.h
+++ b/lib/stdalign.in.h
@@ -103,7 +103,7 @@
 # elif ((defined __APPLE__ && defined __MACH__                  \
          ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__)                 \
          : __GNUC__)                                            \
-        || (__ia64 && (061200 <= __HP_cc || 061200 <= __HP_aCC)) \
+        || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
         || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)
 #  define _Alignas(a) __attribute__ ((__aligned__ (a)))
 # elif 1300 <= _MSC_VER
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index a7572a3..0652a1e 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -35,7 +35,7 @@ AC_DEFUN([gl_STDALIGN_H],
                  || (defined __APPLE__ && defined __MACH__ \
                      ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
                      : __GNUC__) \
-                 || (__ia64 && (061200 <= __HP_cc || 061200 <= __HP_aCC)) \
+                 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
                  || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
                  || 1300 <= _MSC_VER)
               struct alignas_test { char c; char alignas (8) alignas_8; };
diff --git a/tests/test-stdalign.c b/tests/test-stdalign.c
index 8b44d6f..c4b70e1 100644
--- a/tests/test-stdalign.c
+++ b/tests/test-stdalign.c
@@ -84,6 +84,11 @@ main ()
   /* Avoid a test failure due to Sun Studio Developer Bug Report #2125432.  */
   fputs ("Skipping test: known Sun C compiler bug\n", stderr);
   return 77;
+#elif defined __HP_cc && __ia64
+  /* Avoid a test failure due to HP-UX Itanium cc bug; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00078.html  */
+  fputs ("Skipping test: known HP-UX Itanium cc compiler bug\n", stderr);
+  return 77;
 #else
   CHECK_ALIGNED (static_char_alignas);
   CHECK_ALIGNED (static_char_Alignas);
-- 
2.7.4

Reply via email to