[MLton-commit] r4206

Matthew Fluet MLton@mlton.org
Fri, 11 Nov 2005 20:22:27 -0800


gcc warnings
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U   mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/allocTooLarge.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/gc.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/world.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/forward.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.c

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2005-11-12 04:22:23 UTC (rev 4206)
@@ -14,7 +14,7 @@
 GCC_VERSION = 							\
 	$(shell gcc -v 2>&1 | grep 'gcc version' | sed 's/.*gcc version \(.\).*/\1/')
 
-## FLAGS = -fomit-frame-pointer
+FLAGS = -fomit-frame-pointer
 
 ifeq ($(TARGET_ARCH), x86)
 ifneq ($(findstring $(GCC_VERSION), 3 4),)
@@ -61,11 +61,10 @@
 	-Wpacked \
 	-Wredundant-decls \
 	-Wnested-externs 
+#	-Winline -Wdisabled-optimization 
 #	-Wshadow \
-#	-Wconversion \
 #	-Wmissing-prototypes \
-#	-Wmissing-declarations \
-#	-Winline -Wdisabled-optimization
+#	-Wmissing-declarations 
 DEBUGWARNFLAGS = $(DEBUGFLAGS) $(WARNFLAGS) -Wunused
 
 UTILCFILES =							\
@@ -125,7 +124,7 @@
 
 libgdtoa.a: gdtoa/arith.h
 	cd gdtoa && 					\
-		$(CC) $(CFLAGS) 			\
+		$(CC) $(CFLAGS) $(WARNFLAGS)		\
 			-Dstrtod=gdtoa_strtod		\
 			-Dstrtof=gdtoa_strtof		\
 			-w -O1 -c -DINFNAN_CHECK 	\

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -1,10 +1,10 @@
 #include "platform.h"
 
-void Posix_Error_clearErrno () {
+void Posix_Error_clearErrno (void) {
         errno = 0;
 }
 
-int Posix_Error_getErrno () {
+int Posix_Error_getErrno (void) {
         return errno;
 }
 

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -24,7 +24,7 @@
         return sigaction (signum, &sa, NULL);
 }
 
-bool Posix_Signal_isGCPending () {
+bool Posix_Signal_isGCPending (void) {
         Bool res;
 
         res = GC_getGCSignalPending (&gcState);
@@ -52,7 +52,7 @@
         return sigaction (signum, &sa, NULL);
 }
 
-void Posix_Signal_handleGC () {
+void Posix_Signal_handleGC (void) {
         GC_setGCSignalHandled (&gcState, TRUE);
 }
 
@@ -76,7 +76,7 @@
         return res;
 }
 
-void Posix_Signal_resetPending () {
+void Posix_Signal_resetPending (void) {
         if (DEBUG_SIGNALS)
                 fprintf (stderr, "Posix_Signal_resetPending ()\n");
         sigemptyset (GC_getSignalsPendingAddr (&gcState));
@@ -93,11 +93,11 @@
         return sigdelset (&set, signum);
 }
 
-Int Posix_Signal_sigemptyset () {
+Int Posix_Signal_sigemptyset (void) {
         return sigemptyset (&set);
 }
 
-Int Posix_Signal_sigfillset () {
+Int Posix_Signal_sigfillset (void) {
         return sigfillset (&set);
 }
 
@@ -109,7 +109,7 @@
         return sigprocmask (how, &set, &set);
 }
 
-void Posix_Signal_suspend () {
+void Posix_Signal_suspend (void) {
         int res;
 
         res = sigsuspend (&set);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -342,7 +342,7 @@
         mp_limb_t       argspace[2];
         char            *str;
         uint            size;
-        int             i;
+        uint            i;
         char            c;
 
         if (DEBUG_INT_INF)

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/allocTooLarge.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/allocTooLarge.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/allocTooLarge.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -1,6 +1,6 @@
 #include "platform.h"
 
-void MLton_allocTooLarge () {
+void MLton_allocTooLarge (void) {
         fprintf (stderr, "Out of memory: attempt to allocate more than %d bytes.\n", 0x7FFFFFFF);
         exit (2);
 }

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/gc.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/gc.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/gc.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -20,10 +20,10 @@
   GC_setRusageMeasureGC (&gcState, b);
 }
 
-void MLton_GC_pack () {
+void MLton_GC_pack (void) {
   GC_pack (&gcState);
 }
 
-void MLton_GC_unpack () {
+void MLton_GC_unpack (void) {
   GC_unpack (&gcState);
 }

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -6,55 +6,55 @@
 static struct rusage children;
 static struct rusage gc;
 
-Int MLton_Rusage_self_utime_sec () {
+Int MLton_Rusage_self_utime_sec (void) {
         return self.ru_utime.tv_sec;
 }
 
-Int MLton_Rusage_self_utime_usec () {
+Int MLton_Rusage_self_utime_usec (void) {
         return self.ru_utime.tv_usec;
 }
 
-Int MLton_Rusage_self_stime_sec () {
+Int MLton_Rusage_self_stime_sec (void) {
         return self.ru_stime.tv_sec;
 }
 
-Int MLton_Rusage_self_stime_usec () {
+Int MLton_Rusage_self_stime_usec (void) {
         return self.ru_stime.tv_usec;
 }
 
-Int MLton_Rusage_children_utime_sec () {
+Int MLton_Rusage_children_utime_sec (void) {
         return children.ru_utime.tv_sec;
 }
 
-Int MLton_Rusage_children_utime_usec () {
+Int MLton_Rusage_children_utime_usec (void) {
         return children.ru_utime.tv_usec;
 }
 
-Int MLton_Rusage_children_stime_sec () {
+Int MLton_Rusage_children_stime_sec (void) {
         return children.ru_stime.tv_sec;
 }
 
-Int MLton_Rusage_children_stime_usec () {
+Int MLton_Rusage_children_stime_usec (void) {
         return children.ru_stime.tv_usec;
 }
 
-Int MLton_Rusage_gc_utime_sec () {
+Int MLton_Rusage_gc_utime_sec (void) {
         return gc.ru_utime.tv_sec;
 }
 
-Int MLton_Rusage_gc_utime_usec () {
+Int MLton_Rusage_gc_utime_usec (void) {
         return gc.ru_utime.tv_usec;
 }
 
-Int MLton_Rusage_gc_stime_sec () {
+Int MLton_Rusage_gc_stime_sec (void) {
         return gc.ru_stime.tv_sec;
 }
 
-Int MLton_Rusage_gc_stime_usec () {
+Int MLton_Rusage_gc_stime_usec (void) {
         return gc.ru_stime.tv_usec;
 }
 
-void MLton_Rusage_ru () {
+void MLton_Rusage_ru (void) {
         gc = *(GC_getRusageGCAddr (&gcState));
         getrusage (RUSAGE_SELF, &self);
         getrusage (RUSAGE_CHILDREN, &children);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/world.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/world.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/world.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -2,10 +2,10 @@
 
 extern struct GC_state gcState;
 
-Bool World_isOriginal() {
+Bool World_isOriginal(void) {
         return (Bool)(GC_getAmOriginal (&gcState));
 }
 
-void World_makeOriginal() {
+void World_makeOriginal(void) {
         GC_setAmOriginal (&gcState, TRUE);
 }

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -2,11 +2,11 @@
 
 static struct hostent *hostent;
 
-Cstring NetHostDB_Entry_name() {
+Cstring NetHostDB_Entry_name(void) {
         return (Cstring)hostent->h_name;
 }
 
-Int NetHostDB_Entry_numAliases() {
+Int NetHostDB_Entry_numAliases(void) {
         int num = 0;
         while (hostent->h_aliases[num] != NULL) num++;
         return num;
@@ -16,15 +16,15 @@
         return (Cstring)hostent->h_aliases[n];
 }
 
-Int NetHostDB_Entry_addrType() {
+Int NetHostDB_Entry_addrType(void) {
         return hostent->h_addrtype;
 }
 
-Int NetHostDB_Entry_length() {
+Int NetHostDB_Entry_length(void) {
         return hostent->h_length;
 }
 
-Int NetHostDB_Entry_numAddrs() {
+Int NetHostDB_Entry_numAddrs(void) {
         int num = 0;
         while (hostent->h_addr_list[num] != NULL) num++;
         return num;

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -2,11 +2,11 @@
 
 static struct protoent *protoent;
 
-Cstring NetProtDB_Entry_name() {
+Cstring NetProtDB_Entry_name(void) {
         return (Cstring)protoent->p_name;
 }
 
-Int NetProtDB_Entry_numAliases() {
+Int NetProtDB_Entry_numAliases(void) {
         int num = 0;
         while (protoent->p_aliases[num] != NULL) num++;
         return num;
@@ -16,7 +16,7 @@
         return (Cstring)protoent->p_aliases[n];
 }
 
-Int NetProtDB_Entry_protocol() {
+Int NetProtDB_Entry_protocol(void) {
         return protoent->p_proto;
 }
 

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -5,11 +5,11 @@
 
 static struct servent *servent;
 
-Cstring NetServDB_Entry_name() {
+Cstring NetServDB_Entry_name(void) {
         return (Cstring)servent->s_name;
 }
 
-Int NetServDB_Entry_numAliases() {
+Int NetServDB_Entry_numAliases(void) {
         int num = 0;
         while (servent->s_aliases[num] != NULL) num++;
         return num;
@@ -19,11 +19,11 @@
         return (Cstring)servent->s_aliases[n];
 }
 
-Int NetServDB_Entry_port() {
+Int NetServDB_Entry_port(void) {
         return servent->s_port;
 }
 
-Cstring NetServDB_Entry_protocol() {
+Cstring NetServDB_Entry_protocol(void) {
         return (Cstring)servent->s_proto;
 }
 

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -20,7 +20,7 @@
         in_addr = sa->sin_addr;
 }
 
-Int INetSock_getPort () {
+Int INetSock_getPort (void) {
         return port;
 }
 

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/forward.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/forward.h	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/forward.h	2005-11-12 04:22:23 UTC (rev 4206)
@@ -16,7 +16,7 @@
 #define GC_FORWARDED ~((GC_header)0)
 
 bool isPointerInToSpace (GC_state s, pointer p);
-bool isObjptrsInToSpace (GC_state s, objptr op);
+bool isObjptrInToSpace (GC_state s, objptr op);
 void forwardObjptr (GC_state s, objptr *opp);
 void forwardObjptrIfInNursery (GC_state s, objptr *opp);
 void forwardInterGenerationalObjptrs (GC_state s);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h	2005-11-12 04:22:23 UTC (rev 4206)
@@ -14,7 +14,7 @@
   GC_arrayLength length;
   GC_header header;
   uint32_t isneg;
-  uint32_t limbs[0];
+  uint32_t limbs[1];
 } *GC_intInf;
 
 #define GC_INTINF_HEADER GC_WORD32_VECTOR_HEADER

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.h	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.h	2005-11-12 04:22:23 UTC (rev 4206)
@@ -10,5 +10,5 @@
 void threadInternalObjptr (GC_state s, objptr *opp);
 void clearIfWeakAndUnmarkedForMarkCompact (GC_state s, pointer p);
 void updateForwardPointersForMarkCompact (GC_state s);
-void updateBackwardPointersAndSlideForMarkComact (GC_state s);
+void updateBackwardPointersAndSlideForMarkCompact (GC_state s);
 void majorMarkCompactGC (GC_state s);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h	2005-11-12 04:22:23 UTC (rev 4206)
@@ -13,7 +13,7 @@
   GC_arrayCounter counter;
   GC_arrayLength length;
   GC_header header;
-  char chars[0];
+  char chars[1];
 } *GC_string;
 
 #define GC_STRING_HEADER GC_WORD8_VECTOR_HEADER

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.c	2005-11-12 03:11:49 UTC (rev 4205)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.c	2005-11-12 04:22:23 UTC (rev 4206)
@@ -27,7 +27,7 @@
   return (sizeofWeak (s)) - (GC_NORMAL_HEADER_SIZE + sizeof (struct GC_weak));
 }
 
-uint32_t GC_weakCanGet (GC_state s, pointer p) {
+uint32_t GC_weakCanGet (__attribute__ ((unused)) GC_state s, pointer p) {
   uint32_t res;
 
   res = GC_WEAK_GONE_HEADER != getHeader (p);