COUNTER-[PATCH] 64 bit formatting directives on MingW32
Danny Smith
danny_r_smith_2001@yahoo.co.nz
Mon Jul 14 22:36:00 GMT 2003
Earl Chew wrote:
> MingW32 hosted compilers use the Win32 runtime libraries for printing
> and require %I64d to print 64 bit integers.
>
> Earl
>
> 2003-07-14 Earl Chew <earl_chew@agilent.com>
>
> * hwint.h: Add 64 bit formatting directives for MINGW32
>
>
This patch will break bootstrap because of format warnings. The
HOST_WIDE_INT_PRINT changes are wrong (ming32 WIDE_INT is simply long).
Also this ugliness should be hidden away from the rest of the world.
Here is a counter-patch, which has been in my local sandbox for awhile without
causing problems. Bootstrap with todays CVS in progress.
Danny
ChangeLog
2003-07-15 Danny Smith <dannysmith@users.sourcefore.net>
* config/i386/mingw32.h: Override HOST_WIDEST_INT_PRINT*
defines.
* config/i386/t-mingw32: Avoid format warnings while
bootstrapping.
Index: mingw32.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/mingw32.h,v
retrieving revision 1.34
diff -c -3 -p -r1.34 mingw32.h
*** mingw32.h 28 May 2003 20:54:19 -0000 1.34
--- mingw32.h 14 Jul 2003 22:29:47 -0000
*************** do { \
*** 104,106 ****
--- 104,120 ----
/* Define as short unsigned for compatibility with MS runtime. */
#undef WINT_TYPE
#define WINT_TYPE "short unsigned int"
+
+ /* Runtime lib's printf uses 'I64' format specifier, not 'll'. */
+
+ #undef HOST_WIDEST_INT_PRINT_DEC
+ #define HOST_WIDEST_INT_PRINT_DEC "%I64d"
+ #undef HOST_WIDEST_INT_PRINT_DEC_C
+ #define HOST_WIDEST_INT_PRINT_DEC_C "%I64dLL"
+ #undef HOST_WIDEST_INT_PRINT_UNSIGNED
+ #define HOST_WIDEST_INT_PRINT_UNSIGNED "%I64u"
+ #undef HOST_WIDEST_INT_PRINT_HEX
+ #define HOST_WIDEST_INT_PRINT_HEX "0x%I64x"
+ #undef HOST_WIDEST_INT_PRINT_DOUBLE_HEX
+ #define HOST_WIDEST_INT_PRINT_DOUBLE_HEX "0x%I64x%016I64x"
+
Index: t-mingw32
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/t-mingw32,v
retrieving revision 1.3
diff -c -3 -p -r1.3 t-mingw32
*** t-mingw32 11 Jun 2002 05:25:44 -0000 1.3
--- t-mingw32 14 Jul 2003 22:29:47 -0000
*************** USE_COLLECT2=
*** 5,7 ****
--- 5,17 ----
# We hide calls to w32api needed for w32 thread support here:
LIB2FUNCS_EXTRA = $(srcdir)/config/i386/gthr-win32.c
+
+ # runtime lib's printf uses 'I64' format specifier instead of 'll'
+ # for HOST_WIDEST_INT_PRINT_*. Avoid warnings while bootstrapping.
+ bt-load.o-warn = -Wno-format
+ cfg.o-warn = -Wno-format
+ gcov-dump.o-warn = -Wno-format
+ gcov.o-warn = -Wno-format
+ loop-unroll.o-warn = -Wno-format
+ predict.o-warn = -Wno-format
+ profile.o-warn = -Wno-format
http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.
More information about the Gcc-patches
mailing list