re PR target/68739 (FAIL: 30_threads/call_once/constexpr.cc (test for excess errors))
authorJohn David Anglin <danglin@gcc.gnu.org>
Sat, 25 Feb 2017 20:29:39 +0000 (20:29 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 25 Feb 2017 20:29:39 +0000 (20:29 +0000)
PR target/68739
* inclhack.def (hpux11_pthread_pointer): New fix.
(hpux11_pthread_const): Adjust to remove void * cast from define.
* fixincl.x: Regenerate.

From-SVN: r245740

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/sys/pthread.h

index 218a5a23620d2b70303f19a58be821f093963369..4f729dbf63aa7eff45afe3653d618a40b159ff06 100644 (file)
@@ -1,3 +1,10 @@
+2017-02-25  John David Anglin  <danglin@gcc.gnu.org>
+
+       PR target/68739
+       * inclhack.def (hpux11_pthread_pointer): New fix.
+       (hpux11_pthread_const): Adjust to remove void * cast from define.
+       * fixincl.x: Regenerate.
+
 2017-02-11  John David Anglin  <danglin@gcc.gnu.org>
 
        * tests/base/alloca.h: New file.
index ece2b87ce5b4364ff72ea65624b83730552ae0cc..c5be74f2832025b25940f2b713ab2e017ca01056 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Saturday February 11, 2017 at 04:09:01 PM EST
+ * It has been AutoGen-ed  Saturday February 25, 2017 at 03:25:44 PM EST
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat 11 Feb 2017 16:09:01 EST
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sat 25 Feb 2017 15:25:44 EST
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -15,7 +15,7 @@
  * certain ANSI-incompatible system header files which are fixed to work
  * correctly with ANSI C and placed in a directory that GNU C will search.
  *
- * This file contains 247 fixup descriptions.
+ * This file contains 248 fixup descriptions.
  *
  * See README for more information.
  *
@@ -4571,6 +4571,43 @@ static const char* apzHpux11_FabsfPatch[] = {
 #endif",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Hpux11_Pthread_Pointer fix
+ */
+tSCC zHpux11_Pthread_PointerName[] =
+     "hpux11_pthread_pointer";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zHpux11_Pthread_PointerList[] =
+  "sys/pthread.h\0";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzHpux11_Pthread_PointerMachs[] = {
+        "*-hp-hpux11.[0-3]*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zHpux11_Pthread_PointerSelect0[] =
+       "(void[ \t]*\\*)(m|c|rw)(_ptr)";
+
+#define    HPUX11_PTHREAD_POINTER_TEST_CT  1
+static tTestDesc aHpux11_Pthread_PointerTests[] = {
+  { TT_EGREP,    zHpux11_Pthread_PointerSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Hpux11_Pthread_Pointer
+ */
+static const char* apzHpux11_Pthread_PointerPatch[] = {
+    "format",
+    "long\t%2%3",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Hpux11_Pthread_Const fix
@@ -4594,7 +4631,7 @@ tSCC* apzHpux11_Pthread_ConstMachs[] = {
  *  content selection pattern - do fix if pattern found
  */
 tSCC zHpux11_Pthread_ConstSelect0[] =
-       "^#define[ \t]*__POINTER_SET[ \t]*\\(\\(void \\*\\) 1LL\\)";
+       "^(#define[ \t]+__POINTER_SET[ \t0,]*)(.*\\))";
 
 #define    HPUX11_PTHREAD_CONST_TEST_CT  1
 static tTestDesc aHpux11_Pthread_ConstTests[] = {
@@ -4605,7 +4642,7 @@ static tTestDesc aHpux11_Pthread_ConstTests[] = {
  */
 static const char* apzHpux11_Pthread_ConstPatch[] = {
     "format",
-    "#define __POINTER_SET\t\t((void *) 1L)",
+    "%11",
     (char*)NULL };
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -10102,9 +10139,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          284
+#define REGEX_COUNT          285
 #define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT            247
+#define FIX_COUNT            248
 
 /*
  *  Enumerate the fixes
@@ -10216,6 +10253,7 @@ typedef enum {
     HPUX11_EXTERN_SENDFILE_FIXIDX,
     HPUX11_EXTERN_SENDPATH_FIXIDX,
     HPUX11_FABSF_FIXIDX,
+    HPUX11_PTHREAD_POINTER_FIXIDX,
     HPUX11_PTHREAD_CONST_FIXIDX,
     HPUX11_SIZE_T_FIXIDX,
     HPUX11_SNPRINTF_FIXIDX,
@@ -10890,6 +10928,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      HPUX11_FABSF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aHpux11_FabsfTests,   apzHpux11_FabsfPatch, 0 },
 
+  {  zHpux11_Pthread_PointerName,    zHpux11_Pthread_PointerList,
+     apzHpux11_Pthread_PointerMachs,
+     HPUX11_PTHREAD_POINTER_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aHpux11_Pthread_PointerTests,   apzHpux11_Pthread_PointerPatch, 0 },
+
   {  zHpux11_Pthread_ConstName,    zHpux11_Pthread_ConstList,
      apzHpux11_Pthread_ConstMachs,
      HPUX11_PTHREAD_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index fd12062e16561f6f8d3911079f52eb8a0f16174a..8a5514ffcabf4f4b1dc01929a2002632a8f7e3f8 100644 (file)
@@ -2366,16 +2366,34 @@ fix = {
 };
 
 /*
- *  Fix C99 constant in __POINTER_SET define.
+ *  The definitions for PTHREAD_MUTEX_INITIALIZER and similar initializers
+ *  in pthread.h need to be constant expressions to be standard complient.
+ *  As a result, we need to remove the void * casts in the initializers
+ *  (see hpux11_pthread_const) and to change the __(M|C|RW)POINTER defines
+ *  to use the long type.
+ */
+fix = {
+    hackname  = hpux11_pthread_pointer;
+    mach      = "*-hp-hpux11.[0-3]*";
+    files     = sys/pthread.h;
+    select    = "(void[ \t]*\\*)(m|c|rw)(_ptr)";
+
+    c_fix     = format;
+    c_fix_arg = "long\t%2%3";
+    test_text = "#define __MPOINTER\t\tvoid\t *m_ptr";
+};
+
+/*
+ *  Remove void pointer cast and fix C99 constant in __POINTER_SET defines.
  */
 fix = {
     hackname  = hpux11_pthread_const;
     mach      = "*-hp-hpux11.[0-3]*";
     files     = sys/pthread.h;
-    select    = "^#define[ \t]*__POINTER_SET[ \t]*\\(\\(void \\*\\) 1LL\\)";
+    select    = "^(#define[ \t]+__POINTER_SET[ \t0,]*)(.*\\))";
 
     c_fix     = format;
-    c_fix_arg = "#define __POINTER_SET\t\t((void *) 1L)";
+    c_fix_arg = "%11";
     test_text = "#define __POINTER_SET\t\t((void *) 1LL)";
 };
 
index 36f656eb6a615f72cb8ba6087f9aab03969d1fd4..2036580301b726f933b3b5cd210f644927cb7e20 100644 (file)
 #endif  /* HPUX11_LWP_RWLOCK_VALID_CHECK */
 
 
+#if defined( HPUX11_PTHREAD_POINTER_CHECK )
+#define __MPOINTER             long    m_ptr
+#endif  /* HPUX11_PTHREAD_POINTER_CHECK */
+
+
 #if defined( HPUX11_PTHREAD_CONST_CHECK )
-#define __POINTER_SET          ((void *) 1L)
+#define __POINTER_SET          1
 #endif  /* HPUX11_PTHREAD_CONST_CHECK */