OSDN Git Service

fixincludes:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Sep 2005 19:09:27 +0000 (19:09 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Sep 2005 19:09:27 +0000 (19:09 +0000)
PR c++/23139
* inclhack.def (huge_val_hex, huge_valf_hex, huge_vall_hex): New
fixes.
* fixincl.x: Regenerate.
* tests/base/bits/huge_val.h: New file.

gcc/testsuite:
* g++.dg/warn/huge-val1.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104315 138bc75d-0d04-0410-961f-82ee72b054a4

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/bits/huge_val.h [new file with mode: 0644]
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/huge-val1.C [new file with mode: 0644]

index fad54a9..a01267d 100644 (file)
@@ -1,3 +1,11 @@
+2005-09-15  Joseph S. Myers  <joseph@codesourcery.com>
+
+       PR c++/23139
+       * inclhack.def (huge_val_hex, huge_valf_hex, huge_vall_hex): New
+       fixes.
+       * fixincl.x: Regenerate.
+       * tests/base/bits/huge_val.h: New file.
+
 2005-08-14  Kelley Cook  <kcook@gcc.gnu.org>
 
        * All files: Update with new FSF address.
index 5203a43..ae1cda2 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Friday June 24, 2005 at 01:40:52 PM EDT
+ * It has been AutoGen-ed  Thursday September 15, 2005 at 06:55:23 PM UTC
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Jun 24 13:40:52 EDT 2005
+/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Sep 15 18:55:24 UTC 2005
  *
  * 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 190 fixup descriptions.
+ * This file contains 193 fixup descriptions.
  *
  * See README for more information.
  *
@@ -36,8 +36,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with inclhack.  See the file "COPYING".  If not,
  *  write to:  The Free Software Foundation, Inc.,
- *             51 Franklin Street, Fifth Floor,
- *             Boston,  MA  02110-1301, USA.
+ *             59 Temple Place - Suite 330,
+ *             Boston,  MA  02111-1307, USA.
  */
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -2913,6 +2913,132 @@ static const char* apzHpux_SystimePatch[] = {
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Huge_Val_Hex fix
+ */
+tSCC zHuge_Val_HexName[] =
+     "huge_val_hex";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zHuge_Val_HexList[] =
+  "|bits/huge_val.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+#define apzHuge_Val_HexMachs (const char**)NULL
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zHuge_Val_HexSelect0[] =
+       "^#[ \t]*define[ \t]*HUGE_VAL[ \t].*0x1\\.0p.*";
+
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zHuge_Val_HexBypass0[] =
+       "__builtin_huge_val";
+
+#define    HUGE_VAL_HEX_TEST_CT  2
+static tTestDesc aHuge_Val_HexTests[] = {
+  { TT_NEGREP,   zHuge_Val_HexBypass0, (regex_t*)NULL },
+  { TT_EGREP,    zHuge_Val_HexSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Huge_Val_Hex
+ */
+static const char* apzHuge_Val_HexPatch[] = {
+    "format",
+    "#define HUGE_VAL (__builtin_huge_val())\n",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Huge_Valf_Hex fix
+ */
+tSCC zHuge_Valf_HexName[] =
+     "huge_valf_hex";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zHuge_Valf_HexList[] =
+  "|bits/huge_val.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+#define apzHuge_Valf_HexMachs (const char**)NULL
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zHuge_Valf_HexSelect0[] =
+       "^#[ \t]*define[ \t]*HUGE_VALF[ \t].*0x1\\.0p.*";
+
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zHuge_Valf_HexBypass0[] =
+       "__builtin_huge_valf";
+
+#define    HUGE_VALF_HEX_TEST_CT  2
+static tTestDesc aHuge_Valf_HexTests[] = {
+  { TT_NEGREP,   zHuge_Valf_HexBypass0, (regex_t*)NULL },
+  { TT_EGREP,    zHuge_Valf_HexSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Huge_Valf_Hex
+ */
+static const char* apzHuge_Valf_HexPatch[] = {
+    "format",
+    "#define HUGE_VALF (__builtin_huge_valf())\n",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Huge_Vall_Hex fix
+ */
+tSCC zHuge_Vall_HexName[] =
+     "huge_vall_hex";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zHuge_Vall_HexList[] =
+  "|bits/huge_val.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+#define apzHuge_Vall_HexMachs (const char**)NULL
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zHuge_Vall_HexSelect0[] =
+       "^#[ \t]*define[ \t]*HUGE_VALL[ \t].*0x1\\.0p.*";
+
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zHuge_Vall_HexBypass0[] =
+       "__builtin_huge_vall";
+
+#define    HUGE_VALL_HEX_TEST_CT  2
+static tTestDesc aHuge_Vall_HexTests[] = {
+  { TT_NEGREP,   zHuge_Vall_HexBypass0, (regex_t*)NULL },
+  { TT_EGREP,    zHuge_Vall_HexSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Huge_Vall_Hex
+ */
+static const char* apzHuge_Vall_HexPatch[] = {
+    "format",
+    "#define HUGE_VALL (__builtin_huge_vall())\n",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Int_Abort_Free_And_Exit fix
  */
 tSCC zInt_Abort_Free_And_ExitName[] =
@@ -7722,9 +7848,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          229
+#define REGEX_COUNT          235
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            190
+#define FIX_COUNT            193
 
 /*
  *  Enumerate the fixes
@@ -7798,6 +7924,9 @@ typedef enum {
     HPUX_HTONL_FIXIDX,
     HPUX_LONG_DOUBLE_FIXIDX,
     HPUX_SYSTIME_FIXIDX,
+    HUGE_VAL_HEX_FIXIDX,
+    HUGE_VALF_HEX_FIXIDX,
+    HUGE_VALL_HEX_FIXIDX,
     INT_ABORT_FREE_AND_EXIT_FIXIDX,
     IO_QUOTES_DEF_FIXIDX,
     IO_QUOTES_USE_FIXIDX,
@@ -8263,6 +8392,21 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      HPUX_SYSTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aHpux_SystimeTests,   apzHpux_SystimePatch, 0 },
 
+  {  zHuge_Val_HexName,    zHuge_Val_HexList,
+     apzHuge_Val_HexMachs,
+     HUGE_VAL_HEX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aHuge_Val_HexTests,   apzHuge_Val_HexPatch, 0 },
+
+  {  zHuge_Valf_HexName,    zHuge_Valf_HexList,
+     apzHuge_Valf_HexMachs,
+     HUGE_VALF_HEX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aHuge_Valf_HexTests,   apzHuge_Valf_HexPatch, 0 },
+
+  {  zHuge_Vall_HexName,    zHuge_Vall_HexList,
+     apzHuge_Vall_HexMachs,
+     HUGE_VALL_HEX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aHuge_Vall_HexTests,   apzHuge_Vall_HexPatch, 0 },
+
   {  zInt_Abort_Free_And_ExitName,    zInt_Abort_Free_And_ExitList,
      apzInt_Abort_Free_And_ExitMachs,
      INT_ABORT_FREE_AND_EXIT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index 2ff5887..3cfb3e0 100644 (file)
@@ -1681,6 +1681,54 @@ fix = {
 
 
 /*
+ *  Fix glibc definition of HUGE_VAL in terms of hex floating point constant
+ */
+fix = {
+    hackname  = huge_val_hex;
+    files     = bits/huge_val.h;
+    select    = "^#[ \t]*define[ \t]*HUGE_VAL[ \t].*0x1\\.0p.*";
+    bypass    = "__builtin_huge_val";
+
+    c_fix     = format;
+    c_fix_arg = "#define HUGE_VAL (__builtin_huge_val())\n";
+
+    test_text = "# define HUGE_VAL\t(__extension__ 0x1.0p2047)";
+};
+
+
+/*
+ *  Fix glibc definition of HUGE_VALF in terms of hex floating point constant
+ */
+fix = {
+    hackname  = huge_valf_hex;
+    files     = bits/huge_val.h;
+    select    = "^#[ \t]*define[ \t]*HUGE_VALF[ \t].*0x1\\.0p.*";
+    bypass    = "__builtin_huge_valf";
+
+    c_fix     = format;
+    c_fix_arg = "#define HUGE_VALF (__builtin_huge_valf())\n";
+
+    test_text = "#  define HUGE_VALF (__extension__ 0x1.0p255f)";
+};
+
+
+/*
+ *  Fix glibc definition of HUGE_VALL in terms of hex floating point constant
+ */
+fix = {
+    hackname  = huge_vall_hex;
+    files     = bits/huge_val.h;
+    select    = "^#[ \t]*define[ \t]*HUGE_VALL[ \t].*0x1\\.0p.*";
+    bypass    = "__builtin_huge_vall";
+
+    c_fix     = format;
+    c_fix_arg = "#define HUGE_VALL (__builtin_huge_vall())\n";
+
+    test_text = "#  define HUGE_VALL (__extension__ 0x1.0p32767L)";
+};
+
+
+/*
  *  Fix return type of abort and free
  */
 fix = {
diff --git a/fixincludes/tests/base/bits/huge_val.h b/fixincludes/tests/base/bits/huge_val.h
new file mode 100644 (file)
index 0000000..f8bb049
--- /dev/null
@@ -0,0 +1,27 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+       "fixinc/tests/inc/bits/huge_val.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( HUGE_VAL_HEX_CHECK )
+#define HUGE_VAL (__builtin_huge_val())
+
+#endif  /* HUGE_VAL_HEX_CHECK */
+
+
+#if defined( HUGE_VALF_HEX_CHECK )
+#define HUGE_VALF (__builtin_huge_valf())
+
+#endif  /* HUGE_VALF_HEX_CHECK */
+
+
+#if defined( HUGE_VALL_HEX_CHECK )
+#define HUGE_VALL (__builtin_huge_vall())
+
+#endif  /* HUGE_VALL_HEX_CHECK */
index fd27b78..39fc06a 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-15  Joseph S. Myers  <joseph@codesourcery.com>
+
+       PR c++/23139
+       * g++.dg/warn/huge-val1.C: New test.
+
 2005-09-15  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/13140
diff --git a/gcc/testsuite/g++.dg/warn/huge-val1.C b/gcc/testsuite/g++.dg/warn/huge-val1.C
new file mode 100644 (file)
index 0000000..dfa89a6
--- /dev/null
@@ -0,0 +1,31 @@
+// PR c++/23139: HUGE_VAL definition should be accepted with -pedantic.
+// Origin: Joseph Myers <joseph@codesourcery.com>
+// { dg-do link }
+// { dg-options "-pedantic-errors" }
+
+#include <math.h>
+
+double d = HUGE_VAL;
+#ifdef HUGE_VALF
+float f = HUGE_VALF;
+#endif
+#ifdef HUGE_VALL
+long double l = HUGE_VALL;
+#endif
+
+extern void link_failure ();
+
+int
+main ()
+{
+  if (HUGE_VAL != __builtin_huge_val ())
+    link_failure ();
+#ifdef HUGE_VALF
+  if (HUGE_VALF != __builtin_huge_valf ())
+    link_failure ();
+#endif
+#ifdef HUGE_VALL
+  if (HUGE_VALL != __builtin_huge_vall ())
+    link_failure ();
+#endif
+}