This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Need some help with fixincludes.


Hi!

I have made some progress with your help. I have fixed the sed part:
(1) there were missing 's' in the scripts, first I did not noticed it,
then I did not know if I was supposed to povide it;
(2) I have replaced the [ \t]+ by [ \t][ \t]*
to get:

--- ../_gcc_clean/fixincludes/inclhack.def	2009-03-31 22:37:57.000000000 +0200
+++ fixincludes/inclhack.def	2009-04-07 22:28:11.000000000 +0200
@@ -1023,6 +1023,33 @@
 
 
 /*
+ *  Fix stdint.h header on Darwin.
+ */
+fix = {
+    hackname  = darwin_stdint;
+    mach      = "*-*-darwin*";
+    files     = stdint.h;
+    sed = "s/#define[ \t][ \t]*INTPTR_MIN[ \t][ \t]*INT64_MIN/#define INTPTR_MIN ((intptr_t) INT64_MIN)/";
+    sed = "s/#define[ \t][ \t]*INTPTR_MIN[ \t][ \t]*INT32_MIN/#define INTPTR_MIN ((intptr_t) INT32_MIN)/";
+    sed = "s/#define[ \t][ \t]*INTPTR_MAX[ \t][ \t]*INT64_MAX/#define INTPTR_MAX ((intptr_t) INT64_MAX)/";
+    sed = "s/#define[ \t][ \t]*INTPTR_MAX[ \t][ \t]*INT32_MAX/#define INTPTR_MAX ((intptr_t) INT32_MAX)/";
+    sed = "s/#define[ \t][ \t]*UINTPTR_MAX[ \t][ \t]*INT64_MAX/#define UINTPTR_MAX ((uintptr_t) INT64_MAX)/";
+    sed = "s/#define[ \t][ \t]*UINTPTR_MAX[ \t][ \t]*INT32_MAX/#define UINTPTR_MAX ((uintptr_t) INT32_MAX)/";
+    sed = "s/#define[ \t][ \t]*SIZE_MAX[ \t][ \t]*INT32_MAX/#define SIZE_MAX ((size_t) INT32_MAX)/";
+    sed = "s/#define[ \t][ \t]*SIZE_MAX[ \t][ \t]*INT64_MAX/#define SIZE_MAX ((size_t) INT64_MAX)/";
+    sed = "s/#define[ \t][ \t]*UINT8_C(v)[ \t][ \t]*(v ## U)/#define    UINT8_C(v) (v)/";
+    sed = "s/#define[ \t][ \t]*UINT16_C(v)[ \t][ \t]*(v ## U)/#define    UINT16_C(v) (v)/";
+    test_text = "#define INTPTR_MIN        INT64_MIN\n"
+		"#define INTPTR_MAX        INT64_MAX\n"
+		"#define UINTPTR_MAX       UINT64_MAX\n"
+		"#define SIZE_MAX          UINT64_MAX\n"
+		"#define UINT8_C(v)   (v ## U)\n"
+		"#define UINT16_C(v)  (v ## U)\n";
+
+};
+
+
+/*
  *  Fix <c_asm.h> on Digital UNIX V4.0:
  *  It contains a prototype for a DEC C internal asm() function,
  *  clashing with gcc's asm keyword.  So protect this with __DECC.

Now when I run 'make check' in fixincludes I get:

--- /opt/gcc/gcc-4.5-work/fixincludes/tests/base/stdint.h	Wed Apr  1 17:37:21 2009
***************
*** 9,25 ****
  
  
  
- #if defined( DARWIN_STDINT_CHECK )
- #define INTPTR_MIN ((intptr_t) INT64_MIN)
- #define INTPTR_MAX ((intptr_t) INT64_MAX)
- #define UINTPTR_MAX       UINT64_MAX
- #define SIZE_MAX __SIZE_MAX__
- #define    UINT8_C(v) (v)
- #define    UINT16_C(v) (v)
- 
- #endif  /* DARWIN_STDINT_CHECK */
- 
- 
  #if defined( IRIX_STDINT_C99_CHECK )
  #if 0
  #error This header file is to be used only for c99 mode compilations
--- 9,14 ----

If I understand the relevant part of the Joseph's answer I have to do some
change in fixincludes/tests/base/stdint.h by replacing it with
fixincludes/tests/res/stdint.h. Is this correct?

>From the first part of the Joseph's answer, I understand that the
*intptr_t casts in the if block are not permitted, isn't it?
Question: are *intptr_t the right types?

Thanks,

Dominique


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]