[gcc r15-1173] fixincludes: bypass the math_exception fix on __cplusplus

François-Xavier Coudert fxcoudert@gcc.gnu.org
Tue Jun 11 05:59:53 GMT 2024


https://gcc.gnu.org/g:66d6b1861ec57ba29540a5fa7854df3978ba5409

commit r15-1173-g66d6b1861ec57ba29540a5fa7854df3978ba5409
Author: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date:   Fri Jun 7 11:05:39 2024 +0200

    fixincludes: bypass the math_exception fix on __cplusplus
    
    fixincludes/ChangeLog:
    
            * fixincl.x: Regenerate.
            * inclhack.def (math_exception): Bypass on __cplusplus.
            * tests/base/math.h: Regenerate.

Diff:
---
 fixincludes/fixincl.x         | 12 +++++-------
 fixincludes/inclhack.def      | 12 +-----------
 fixincludes/tests/base/math.h | 11 -----------
 3 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index caaff2883e0..54a530b50ca 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
  *
  * DO NOT EDIT THIS FILE   (fixincl.x)
  *
- * It has been AutoGen-ed  June  4, 2024 at 02:35:55 PM by AutoGen 5.18.16
+ * It has been AutoGen-ed  June  7, 2024 at 11:03:58 AM by AutoGen 5.18.16
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Jun  4 14:35:55 CEST 2024
+/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Jun  7 11:03:58 CEST 2024
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -6793,9 +6793,7 @@ tSCC zMath_ExceptionList[] =
 /*
  *  Machine/OS name selection pattern
  */
-tSCC* apzMath_ExceptionMachs[] = {
-        "*-*-solaris2.1[0-9]*",
-        (const char*)NULL };
+#define apzMath_ExceptionMachs (const char**)NULL
 
 /*
  *  content selection pattern - do fix if pattern found
@@ -6807,7 +6805,7 @@ tSCC zMath_ExceptionSelect0[] =
  *  content bypass pattern - skip fix if pattern found
  */
 tSCC zMath_ExceptionBypass0[] =
-       "We have a problem when using C\\+\\+|for C\\+\\+, _[a-z0-9A-Z_]+_exception; for C, exception";
+       "__cplusplus";
 
 #define    MATH_EXCEPTION_TEST_CT  2
 static tTestDesc aMath_ExceptionTests[] = {
@@ -12304,7 +12302,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
 
   {  zMath_ExceptionName,    zMath_ExceptionList,
      apzMath_ExceptionMachs,
-     MATH_EXCEPTION_TEST_CT, FD_MACH_IFNOT | FD_SUBROUTINE,
+     MATH_EXCEPTION_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aMath_ExceptionTests,   apzMath_ExceptionPatch, 0 },
 
   {  zMath_Huge_Val_From_Dbl_MaxName,    zMath_Huge_Val_From_Dbl_MaxList,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 35402d0621c..f7fc5cdbabd 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -3412,17 +3412,7 @@ fix = {
     hackname  = math_exception;
     files     = math.h;
     select    = "struct exception";
-    /*
-     * This should be bypassed on __cplusplus, but some supposedly C++
-     * aware headers, such as Solaris 8 and 9, don't wrap their struct
-     * exception either.  So currently we bypass only for glibc, based on a
-     * comment in the fixed glibc header.  Ick.
-     */
-    bypass    = 'We have a problem when using C\+\+|for C\+\+, '
-		'_[a-z0-9A-Z_]+_exception; for C, exception';
-    /* The Solaris 10 headers already get this right.  */
-    mach   = '*-*-solaris2.1[0-9]*';
-    not_machine = true;
+    bypass    = '__cplusplus';
     c_fix     = wrap;
 
     c_fix_arg = "#ifdef __cplusplus\n"
diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
index 7b92f29a409..3c378c5df95 100644
--- a/fixincludes/tests/base/math.h
+++ b/fixincludes/tests/base/math.h
@@ -7,12 +7,6 @@
     This had to be done to correct non-standard usages in the
     original, manufacturer supplied header file.  */
 
-#ifndef FIXINC_WRAP_MATH_H_MATH_EXCEPTION
-#define FIXINC_WRAP_MATH_H_MATH_EXCEPTION 1
-
-#ifdef __cplusplus
-#define exception __math_exception
-#endif
 
 
 #if defined( BROKEN_CABS_CHECK )
@@ -146,8 +140,3 @@ int foo;
 #endif /* _C99 */
 
 #endif  /* VXWORKS_MATH_H_FP_C99_CHECK */
-#ifdef __cplusplus
-#undef exception
-#endif
-
-#endif  /* FIXINC_WRAP_MATH_H_MATH_EXCEPTION */


More information about the Gcc-cvs mailing list