[MLton-commit] r4527
Stephen Weeks
MLton@mlton.org
Wed, 10 May 2006 14:44:36 -0700
Eliminated -Winline.
Fixed gdtoa warnings, using gdtoa-patch.
Eliminated prototypes of gdtoa_strtof and gdtoa_strtod from
platform.h, becuase they cause spurious warnings in files that include
both platform.h and gdtoa.h, like basis/Real/gdtoa.c. Instead, I
explicitly added a prototype in the only place where it's currently
otherwise needed, in runtime/gc/init.c.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/strto.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gdtoa-patch
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-10 20:42:07 UTC (rev 4526)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-10 21:44:36 UTC (rev 4527)
@@ -104,7 +104,7 @@
WARNCFLAGS += -Wnested-externs
WARNCFLAGS += -Wlong-long
# WARNCFLAGS += -Wunreachable-code
-OPTWARNCFLAGS = $(WARNCFLAGS) -Winline -Wdisabled-optimization
+OPTWARNCFLAGS = $(WARNCFLAGS) -Wdisabled-optimization
DEBUGWARNCFLAGS = $(WARNCFLAGS)
UTILCFILES = \
@@ -167,8 +167,6 @@
libgdtoa.a: gdtoa/arith.h
cd gdtoa && \
$(CC) $(OPTCFLAGS) $(OPTWARNCFLAGS) \
- -Dstrtod=gdtoa_strtod \
- -Dstrtof=gdtoa_strtof \
-w -O1 -c -DINFNAN_CHECK \
*.c
$(AR) libgdtoa.a gdtoa/*.o
@@ -259,7 +257,7 @@
.PHONY: gdtoa-patch
gdtoa-patch:
- cd gdtoa && $(MAKE) clean && rm -f &~
+ cd gdtoa && $(MAKE) clean && rm -f *~
mv gdtoa gdtoa-new
gzip -dc gdtoa.tgz | tar xf -
diff -P -C 2 -r gdtoa gdtoa-new >gdtoa-patch || exit 0
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/strto.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/strto.c 2006-05-10 20:42:07 UTC (rev 4526)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/strto.c 2006-05-10 21:44:36 UTC (rev 4527)
@@ -1,4 +1,5 @@
#include "platform.h"
+#include "gdtoa/gdtoa.h"
Real32_t Real32_strto (NullString8_t s) {
char *endptr;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c 2006-05-10 20:42:07 UTC (rev 4526)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c 2006-05-10 21:44:36 UTC (rev 4527)
@@ -20,6 +20,10 @@
}
#endif
+// From gdtoa/gdtoa.h.
+// Can't include the whole thing because it brings in too much junk.
+float gdtoa_strtof (const char *, char **);
+
static float stringToFloat (char *s) {
char *endptr;
float f;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gdtoa-patch
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gdtoa-patch 2006-05-10 20:42:07 UTC (rev 4526)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gdtoa-patch 2006-05-10 21:44:36 UTC (rev 4527)
@@ -0,0 +1,74 @@
+diff -P -C 2 -r gdtoa/arithchk.c gdtoa-new/arithchk.c
+*** gdtoa/arithchk.c 1998-06-19 13:46:11.000000000 -0700
+--- gdtoa-new/arithchk.c 2006-05-10 14:12:02.477056503 -0700
+***************
+*** 137,141 ****
+ }
+
+! main()
+ {
+ Akind *a = 0;
+--- 137,141 ----
+ }
+
+! int main()
+ {
+ Akind *a = 0;
+diff -P -C 2 -r gdtoa/gdtoa.h gdtoa-new/gdtoa.h
+*** gdtoa/gdtoa.h 2000-11-01 07:01:39.000000000 -0800
+--- gdtoa-new/gdtoa.h 2006-05-10 14:06:30.680495461 -0700
+***************
+*** 114,119 ****
+ int mode, int ndigits, int *decpt, char **rve));
+ extern void freedtoa ANSI((char*));
+! extern float strtof ANSI((CONST char *, char **));
+! extern double strtod ANSI((CONST char *, char **));
+ extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*));
+
+--- 114,119 ----
+ int mode, int ndigits, int *decpt, char **rve));
+ extern void freedtoa ANSI((char*));
+! extern float gdtoa_strtof ANSI((CONST char *, char **));
+! extern double gdtoa_strtod ANSI((CONST char *, char **));
+ extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*));
+
+diff -P -C 2 -r gdtoa/strtod.c gdtoa-new/strtod.c
+*** gdtoa/strtod.c 2003-03-21 13:24:01.000000000 -0800
+--- gdtoa-new/strtod.c 2006-05-10 14:05:47.597263849 -0700
+***************
+*** 59,63 ****
+
+ double
+! strtod
+ #ifdef KR_headers
+ (s00, se) CONST char *s00; char **se;
+--- 59,63 ----
+
+ double
+! gdtoa_strtod
+ #ifdef KR_headers
+ (s00, se) CONST char *s00; char **se;
+diff -P -C 2 -r gdtoa/strtof.c gdtoa-new/strtof.c
+*** gdtoa/strtof.c 2000-11-01 20:31:40.000000000 -0800
+--- gdtoa-new/strtof.c 2006-05-10 14:06:15.872478149 -0700
+***************
+*** 38,46 ****
+ #include "gdtoaimp.h"
+
+! float
+ #ifdef KR_headers
+! strtof(s, sp) CONST char *s; char **sp;
+ #else
+! strtof(CONST char *s, char **sp)
+ #endif
+ {
+--- 38,46 ----
+ #include "gdtoaimp.h"
+
+! float gdtoa_strtof
+ #ifdef KR_headers
+! (s, sp) CONST char *s; char **sp;
+ #else
+! (CONST char *s, char **sp)
+ #endif
+ {
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-10 20:42:07 UTC (rev 4526)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-10 21:44:36 UTC (rev 4527)
@@ -106,13 +106,6 @@
#include "basis-ffi.h"
/* ---------------------------------------------------------------- */
-/* gdtoa */
-/* ---------------------------------------------------------------- */
-
-Real32_t gdtoa_strtof (const char *s, char **endptr);
-Real64_t gdtoa_strtod (const char *s, char **endptr);
-
-/* ---------------------------------------------------------------- */
/* Runtime Init/Exit */
/* ---------------------------------------------------------------- */