Commit 9f611ccc authored by Ian Lynagh's avatar Ian Lynagh

Merge win:c:/m64/reg8

parents bfd86332 3d8dd486
......@@ -357,6 +357,7 @@ data WarningFlag =
| Opt_WarnUnsafe
| Opt_WarnSafe
| Opt_WarnPointlessPragmas
| Opt_WarnUnsupportedCallingConventions
deriving (Eq, Show, Enum)
data Language = Haskell98 | Haskell2010
......@@ -1842,7 +1843,8 @@ fWarningFlags = [
( "warn-alternative-layout-rule-transitional", Opt_WarnAlternativeLayoutRuleTransitional, nop ),
( "warn-unsafe", Opt_WarnUnsafe, setWarnUnsafe ),
( "warn-safe", Opt_WarnSafe, setWarnSafe ),
( "warn-pointless-pragmas", Opt_WarnPointlessPragmas, nop ) ]
( "warn-pointless-pragmas", Opt_WarnPointlessPragmas, nop ),
( "warn-unsupported-calling-conventions", Opt_WarnUnsupportedCallingConventions, nop ) ]
-- | These @-f\<blah\>@ flags can all be reversed with @-fno-\<blah\>@
fFlags :: [FlagSpec DynFlag]
......@@ -2174,7 +2176,8 @@ standardWarnings
Opt_WarnDodgyForeignImports,
Opt_WarnWrongDoBind,
Opt_WarnAlternativeLayoutRuleTransitional,
Opt_WarnPointlessPragmas
Opt_WarnPointlessPragmas,
Opt_WarnUnsupportedCallingConventions
]
minusWOpts :: [WarningFlag]
......
......@@ -48,6 +48,8 @@ import Platform
import SrcLoc
import Bag
import FastString
import Control.Monad
\end{code}
\begin{code}
......@@ -454,7 +456,8 @@ checkCConv StdCallConv = do dflags <- getDynFlags
if platformArch platform == ArchX86
then return StdCallConv
else do -- This is a warning, not an error. see #3336
addWarnTc (text "the 'stdcall' calling convention is unsupported on this platform," $$ text "treating as ccall")
when (wopt Opt_WarnUnsupportedCallingConventions dflags) $
addWarnTc (text "the 'stdcall' calling convention is unsupported on this platform," $$ text "treating as ccall")
return CCallConv
checkCConv PrimCallConv = do addErrTc (text "The `prim' calling convention can only be used with `foreign import'")
return PrimCallConv
......
......@@ -4,6 +4,7 @@ for various bits of the RTS. They are linked
in instead of the defaults.
*/
#include "../rts/PosixSource.h"
#include "Rts.h"
#include "HsFFI.h"
......@@ -31,8 +32,8 @@ defaultsHook (void)
}
void
StackOverflowHook (unsigned long stack_size) /* in bytes */
StackOverflowHook (lnat stack_size) /* in bytes */
{
fprintf(stderr, "GHC stack-space overflow: current limit is %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size);
fprintf(stderr, "GHC stack-space overflow: current limit is %" FMT_SizeT " bytes.\nUse the `-K<size>' option to increase it.\n", stack_size);
}
......@@ -145,15 +145,24 @@ void _assertFail(const char *filename, unsigned int linenum)
#if SIZEOF_VOID_P == 8
# if SIZEOF_LONG == 8
# define FMT_SizeT "lu"
# define FMT_SizeT "lu"
# define FMT_HexSizeT "lx"
# define FMT_Word "lu"
# define FMT_Int "ld"
# elif SIZEOF_LONG_LONG == 8
# define FMT_SizeT "llu"
# define FMT_SizeT "llu"
# define FMT_HexSizeT "llx"
# define FMT_Word "llu"
# define FMT_Int "lld"
# else
# error Cannot find format specifier for size_t size type
# endif
#elif SIZEOF_VOID_P == 4
# if SIZEOF_INT == 4
# define FMT_SizeT "u"
# define FMT_SizeT "u"
# define FMT_HexSizeT "x"
# define FMT_Word "u"
# define FMT_Int "d"
# else
# error Cannot find format specifier for size_t size type
# endif
......
......@@ -21,6 +21,7 @@
#define PROFILING
#define THREADED_RTS
#include "PosixSource.h"
#include "Rts.h"
#include "Stable.h"
#include "Capability.h"
......@@ -199,7 +200,7 @@ main(int argc, char *argv[])
printf("#define BLOCK_SIZE %u\n", BLOCK_SIZE);
printf("#define MBLOCK_SIZE %u\n", MBLOCK_SIZE);
printf("#define BLOCKS_PER_MBLOCK %lu\n", (lnat)BLOCKS_PER_MBLOCK);
printf("#define BLOCKS_PER_MBLOCK %" FMT_SizeT "\n", (lnat)BLOCKS_PER_MBLOCK);
// could be derived, but better to save doing the calculation twice
printf("\n\n");
......
......@@ -18,9 +18,9 @@ extern char *ghc_rts_opts;
extern void OnExitHook (void);
extern int NoRunnableThreadsHook (void);
extern void StackOverflowHook (unsigned long stack_size);
extern void OutOfHeapHook (unsigned long request_size, unsigned long heap_size);
extern void MallocFailHook (unsigned long request_size /* in bytes */, char *msg);
extern void StackOverflowHook (lnat stack_size);
extern void OutOfHeapHook (lnat request_size, lnat heap_size);
extern void MallocFailHook (lnat request_size /* in bytes */, char *msg);
extern void defaultsHook (void);
#endif /* RTS_HOOKS_H */
......@@ -14,8 +14,8 @@
#ifndef RTS_TYPES_H
#define RTS_TYPES_H
typedef unsigned int nat; /* at least 32 bits (like int) */
typedef unsigned long lnat; /* at least 32 bits */
typedef unsigned int nat; /* at least 32 bits (like int) */
typedef size_t lnat; /* at least 32 bits */
/* ullong (64|128-bit) type: only include if needed (not ANSI) */
#if defined(__GNUC__)
......
# DO NOT EDIT! Instead, create a file mk/validate.mk, whose settings will
# override these. See also mk/custom-settings.mk.
WERROR = -Werror
WERROR = -Werror
SRC_CC_WARNING_OPTS =
SRC_HC_WARNING_OPTS =
HADDOCK_DOCS = YES
SRC_CC_OPTS += -Wall $(WERROR)
# Debian doesn't turn -Werror=unused-but-set-variable on by default, so
# we turn it on explicitly for consistency with other users
ifeq "$(GccLT46)" "NO"
SRC_CC_OPTS += -Werror=unused-but-set-variable
SRC_CC_WARNING_OPTS += -Werror=unused-but-set-variable
# gcc 4.6 gives 3 warning for giveCapabilityToTask not being inlined
SRC_CC_OPTS += -Wno-error=inline
SRC_CC_WARNING_OPTS += -Wno-error=inline
endif
SRC_HC_OPTS += -Wall $(WERROR) -H64m -O0
SRC_CC_OPTS += $(WERROR) -Wall
SRC_HC_OPTS += $(WERROR) -Wall -H64m -O0
GhcStage1HcOpts += -O -fwarn-tabs
......
......@@ -419,7 +419,7 @@ giveCapabilityToTask (Capability *cap USED_IF_DEBUG, Task *task)
ASSERT(task->cap == cap);
debugTrace(DEBUG_sched, "passing capability %d to %s %p",
cap->no, task->incall->tso ? "bound task" : "worker",
(void *)task->id);
(void *)(size_t)task->id);
ACQUIRE_LOCK(&task->lock);
if (task->wakeup == rtsFalse) {
task->wakeup = rtsTrue;
......@@ -887,7 +887,7 @@ shutdownCapability (Capability *cap USED_IF_THREADS,
for (t = cap->spare_workers; t != NULL; t = t->next) {
if (!osThreadIsAlive(t->id)) {
debugTrace(DEBUG_sched,
"worker thread %p has died unexpectedly", (void *)t->id);
"worker thread %p has died unexpectedly", (void *)(size_t)t->id);
cap->n_spare_workers--;
if (!prev) {
cap->spare_workers = t->next;
......
......@@ -75,12 +75,12 @@ disInstr ( StgBCO *bco, int pc )
instrs[pc], (signed int)instrs[pc+1]);
pc += 2; break;
case bci_CCALL:
debugBelch("CCALL marshaller at 0x%lx\n",
debugBelch("CCALL marshaller at 0x%" FMT_HexSizeT "\n",
literals[instrs[pc]] );
pc += 1; break;
case bci_STKCHECK: {
StgWord stk_words_reqd = BCO_GET_LARGE_ARG + 1;
debugBelch("STKCHECK %lu\n", (lnat)stk_words_reqd );
debugBelch("STKCHECK %" FMT_SizeT "\n", (lnat)stk_words_reqd );
break;
}
case bci_PUSH_L:
......@@ -130,7 +130,7 @@ disInstr ( StgBCO *bco, int pc )
case bci_PUSH_UBX:
debugBelch("PUSH_UBX ");
for (i = 0; i < instrs[pc+1]; i++)
debugBelch("0x%lx ", literals[i + instrs[pc]] );
debugBelch("0x%" FMT_HexSizeT " ", literals[i + instrs[pc]] );
debugBelch("\n");
pc += 2; break;
case bci_PUSH_APPLY_N:
......@@ -199,29 +199,29 @@ disInstr ( StgBCO *bco, int pc )
case bci_TESTLT_I: {
unsigned int discr = BCO_NEXT;
int failto = BCO_GET_LARGE_ARG;
debugBelch("TESTLT_I %ld, fail to %d\n", literals[discr], failto);
debugBelch("TESTLT_I %" FMT_Int ", fail to %d\n", literals[discr], failto);
break;
}
case bci_TESTEQ_I:
debugBelch("TESTEQ_I %ld, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTEQ_I %" FMT_Int ", fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTLT_F:
debugBelch("TESTLT_F %ld, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTLT_F %" FMT_Int ", fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTEQ_F:
debugBelch("TESTEQ_F %ld, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTEQ_F %" FMT_Int ", fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTLT_D:
debugBelch("TESTLT_D %ld, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTLT_D %" FMT_Int ", fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTEQ_D:
debugBelch("TESTEQ_D %ld, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTEQ_D %" FMT_Int ", fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
......
......@@ -2428,6 +2428,7 @@ addProddableBlock ( ObjectCode* oc, void* start, int size )
oc->proddables = pb;
}
#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
static void
checkProddableBlock (ObjectCode *oc, void *addr )
{
......@@ -2444,6 +2445,7 @@ checkProddableBlock (ObjectCode *oc, void *addr )
}
barf("checkProddableBlock: invalid fixup in runtime linker");
}
#endif
/* -----------------------------------------------------------------------------
* Section management.
......@@ -2459,8 +2461,8 @@ addSection ( ObjectCode* oc, SectionKind kind,
s->next = oc->sections;
oc->sections = s;
IF_DEBUG(linker, debugBelch("addSection: %p-%p (size %ld), kind %d\n",
start, ((char*)end)-1, (long)end - (long)start + 1, kind ));
IF_DEBUG(linker, debugBelch("addSection: %p-%p (size %" FMT_Int "), kind %d\n",
start, ((char*)end)-1, (StgInt)end - (StgInt)start + 1, kind ));
}
......@@ -2473,6 +2475,7 @@ addSection ( ObjectCode* oc, SectionKind kind,
*/
#if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) || defined(arm_HOST_ARCH)
#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
/*
ocAllocateSymbolExtras
......@@ -2551,6 +2554,7 @@ static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first )
return 1;
}
#endif
#endif // defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) || defined(arm_HOST_ARCH)
#if defined(arm_HOST_ARCH)
......@@ -2567,6 +2571,7 @@ ocFlushInstructionCache( ObjectCode *oc )
#endif
#if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
static SymbolExtra* makeSymbolExtra( ObjectCode* oc,
unsigned long symbolNumber,
......@@ -2604,6 +2609,7 @@ static SymbolExtra* makeSymbolExtra( ObjectCode* oc,
return extra;
}
#endif
#endif // defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
#ifdef arm_HOST_ARCH
......@@ -2887,6 +2893,7 @@ printName ( UChar* name, UChar* strtab )
}
#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
static void
copyName ( UChar* name, UChar* strtab, UChar* dst, int dstSize )
{
......@@ -2905,6 +2912,7 @@ copyName ( UChar* name, UChar* strtab, UChar* dst, int dstSize )
dst[i] = 0;
}
}
#endif
static UChar *
......@@ -2960,6 +2968,7 @@ cstring_from_section_name (UChar* name, UChar* strtab)
}
}
#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
/* Just compares the short names (first 8 chars) */
static COFF_section *
findPEi386SectionCalled ( ObjectCode* oc, UChar* name )
......@@ -2988,7 +2997,7 @@ findPEi386SectionCalled ( ObjectCode* oc, UChar* name )
return NULL;
}
#endif
static void
zapTrailingAtSign ( UChar* sym )
......@@ -3099,9 +3108,9 @@ ocVerifyImage_PEi386 ( ObjectCode* oc )
IF_DEBUG(linker, i=1);
if (i == 0) return 1;
debugBelch( "sectab offset = %d\n", ((UChar*)sectab) - ((UChar*)hdr) );
debugBelch( "symtab offset = %d\n", ((UChar*)symtab) - ((UChar*)hdr) );
debugBelch( "strtab offset = %d\n", ((UChar*)strtab) - ((UChar*)hdr) );
debugBelch( "sectab offset = %" FMT_Int "\n", ((UChar*)sectab) - ((UChar*)hdr) );
debugBelch( "symtab offset = %" FMT_Int "\n", ((UChar*)symtab) - ((UChar*)hdr) );
debugBelch( "strtab offset = %" FMT_Int "\n", ((UChar*)strtab) - ((UChar*)hdr) );
debugBelch("\n" );
debugBelch( "Machine: 0x%x\n", (UInt32)(hdr->Machine) );
......@@ -3451,8 +3460,13 @@ ocGetNames_PEi386 ( ObjectCode* oc )
static int
ocResolve_PEi386 ( ObjectCode* oc )
ocResolve_PEi386 ( ObjectCode* oc
#if !defined(i386_HOST_ARCH)
STG_UNUSED
#endif
)
{
#if defined(i386_HOST_ARCH)
COFF_header* hdr;
COFF_section* sectab;
COFF_symbol* symtab;
......@@ -3535,7 +3549,6 @@ ocResolve_PEi386 ( ObjectCode* oc )
j = 0;
}
for (; j < noRelocs; j++) {
COFF_symbol* sym;
COFF_reloc* reltab_j
......@@ -3627,6 +3640,9 @@ ocResolve_PEi386 ( ObjectCode* oc )
IF_DEBUG(linker, debugBelch("completed %" PATH_FMT, oc->fileName));
return 1;
#else
barf("ocResolve_PEi386: Not supported on this arch");
#endif
}
#endif /* defined(OBJFORMAT_PEi386) */
......
......@@ -147,7 +147,7 @@ printClosure( StgClosure *obj )
case FUN_1_0: case FUN_0_1:
case FUN_1_1: case FUN_0_2: case FUN_2_0:
case FUN_STATIC:
debugBelch("FUN/%d(",itbl_to_fun_itbl(info)->f.arity);
debugBelch("FUN/%d(",(int)itbl_to_fun_itbl(info)->f.arity);
printPtr((StgPtr)obj->header.info);
#ifdef PROFILING
debugBelch(", %s", obj->header.prof.ccs->cc->label);
......@@ -199,7 +199,7 @@ printClosure( StgClosure *obj )
{
StgPAP* pap = (StgPAP*)obj;
StgWord i;
debugBelch("PAP/%d(",pap->arity);
debugBelch("PAP/%d(",(int)pap->arity);
printPtr((StgPtr)pap->fun);
for (i = 0; i < pap->n_args; ++i) {
debugBelch(", ");
......@@ -299,21 +299,21 @@ printClosure( StgClosure *obj )
StgWord i;
debugBelch("ARR_WORDS(\"");
for (i=0; i<arr_words_words((StgArrWords *)obj); i++)
debugBelch("%lu", (lnat)((StgArrWords *)obj)->payload[i]);
debugBelch("%" FMT_SizeT, (lnat)((StgArrWords *)obj)->payload[i]);
debugBelch("\")\n");
break;
}
case MUT_ARR_PTRS_CLEAN:
debugBelch("MUT_ARR_PTRS_CLEAN(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
debugBelch("MUT_ARR_PTRS_CLEAN(size=%" FMT_SizeT ")\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
break;
case MUT_ARR_PTRS_DIRTY:
debugBelch("MUT_ARR_PTRS_DIRTY(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
debugBelch("MUT_ARR_PTRS_DIRTY(size=%" FMT_SizeT ")\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
break;
case MUT_ARR_PTRS_FROZEN:
debugBelch("MUT_ARR_PTRS_FROZEN(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
debugBelch("MUT_ARR_PTRS_FROZEN(size=%" FMT_SizeT ")\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
break;
case MVAR_CLEAN:
......@@ -366,7 +366,7 @@ printClosure( StgClosure *obj )
default:
//barf("printClosure %d",get_itbl(obj)->type);
debugBelch("*** printClosure: unknown type %d ****\n",
get_itbl(obj)->type );
(int)get_itbl(obj)->type );
barf("printClosure %d",get_itbl(obj)->type);
return;
}
......@@ -426,7 +426,7 @@ printSmallBitmap( StgPtr spBottom, StgPtr payload, StgWord bitmap, nat size )
printPtr((P_)payload[i]);
debugBelch("\n");
} else {
debugBelch("Word# %lu\n", (lnat)payload[i]);
debugBelch("Word# %" FMT_SizeT "\n", (lnat)payload[i]);
}
}
}
......@@ -442,12 +442,12 @@ printLargeBitmap( StgPtr spBottom, StgPtr payload, StgLargeBitmap* large_bitmap,
StgWord bitmap = large_bitmap->bitmap[bmp];
j = 0;
for(; i < size && j < BITS_IN(W_); j++, i++, bitmap >>= 1 ) {
debugBelch(" stk[%lu] (%p) = ", (lnat)(spBottom-(payload+i)), payload+i);
debugBelch(" stk[%" FMT_SizeT "] (%p) = ", (lnat)(spBottom-(payload+i)), payload+i);
if ((bitmap & 1) == 0) {
printPtr((P_)payload[i]);
debugBelch("\n");
} else {
debugBelch("Word# %lu\n", (lnat)payload[i]);
debugBelch("Word# %" FMT_SizeT "\n", (lnat)payload[i]);
}
}
}
......@@ -532,7 +532,7 @@ printStackChunk( StgPtr sp, StgPtr spBottom )
ret_fun = (StgRetFun *)sp;
fun_info = get_fun_itbl(ret_fun->fun);
debugBelch("RET_FUN (%p) (type=%d)\n", ret_fun->fun, fun_info->f.fun_type);
debugBelch("RET_FUN (%p) (type=%d)\n", ret_fun->fun, (int)fun_info->f.fun_type);
switch (fun_info->f.fun_type) {
case ARG_GEN:
printSmallBitmap(spBottom, sp+2,
......@@ -554,7 +554,7 @@ printStackChunk( StgPtr sp, StgPtr spBottom )
}
default:
debugBelch("unknown object %d\n", info->type);
debugBelch("unknown object %d\n", (int)info->type);
barf("printStackChunk");
}
}
......
......@@ -821,7 +821,7 @@ dumpCensus( Census *census )
}
#endif
fprintf(hp_file, "\t%lu\n", (unsigned long)count * sizeof(W_));
fprintf(hp_file, "\t%" FMT_SizeT "\n", (lnat)count * sizeof(W_));
}
printSample(rtsFalse, census->time);
......
......@@ -1542,7 +1542,7 @@ decodeSize(const char *flag, nat offset, StgWord64 min, StgWord64 max)
if (m < 0 || val < min || val > max) {
// printf doesn't like 64-bit format specs on Windows
// apparently, so fall back to unsigned long.
errorBelch("error in RTS option %s: size outside allowed range (%lu - %lu)", flag, (lnat)min, (lnat)max);
errorBelch("error in RTS option %s: size outside allowed range (%" FMT_SizeT " - %" FMT_SizeT ")", flag, (lnat)min, (lnat)max);
stg_exit(EXIT_FAILURE);
}
......
......@@ -383,10 +383,10 @@ stat_endGC (Capability *cap, gc_thread *gct,
if (RtsFlags.GcFlags.giveStats == VERBOSE_GC_STATS) {
nat faults = getPageFaults();
statsPrintf("%9ld %9ld %9ld",
statsPrintf("%9" FMT_SizeT " %9" FMT_SizeT " %9" FMT_SizeT,
alloc*sizeof(W_), copied*sizeof(W_),
live*sizeof(W_));
statsPrintf(" %5.2f %5.2f %7.2f %7.2f %4ld %4ld (Gen: %2d)\n",
statsPrintf(" %5.2f %5.2f %7.2f %7.2f %4" FMT_SizeT " %4" FMT_SizeT " (Gen: %2d)\n",
TimeToSecondsDbl(gc_cpu),
TimeToSecondsDbl(gc_elapsed),
TimeToSecondsDbl(cpu),
......@@ -627,7 +627,7 @@ stat_exit(int alloc)
if (tot_elapsed == 0.0) tot_elapsed = 1;
if (RtsFlags.GcFlags.giveStats >= VERBOSE_GC_STATS) {
statsPrintf("%9ld %9.9s %9.9s", (lnat)alloc*sizeof(W_), "", "");
statsPrintf("%9" FMT_SizeT " %9.9s %9.9s", (lnat)alloc*sizeof(W_), "", "");
statsPrintf(" %5.2f %5.2f\n\n", 0.0, 0.0);
}
......@@ -666,14 +666,14 @@ stat_exit(int alloc)
if ( residency_samples > 0 ) {
showStgWord64(max_residency*sizeof(W_),
temp, rtsTrue/*commas*/);
statsPrintf("%16s bytes maximum residency (%ld sample(s))\n",
statsPrintf("%16s bytes maximum residency (%" FMT_SizeT " sample(s))\n",
temp, residency_samples);
}
showStgWord64(max_slop*sizeof(W_), temp, rtsTrue/*commas*/);
statsPrintf("%16s bytes maximum slop\n", temp);
statsPrintf("%16ld MB total memory in use (%ld MB lost due to fragmentation)\n\n",
statsPrintf("%16" FMT_SizeT " MB total memory in use (%" FMT_SizeT " MB lost due to fragmentation)\n\n",
peak_mblocks_allocated * MBLOCK_SIZE_W / (1024 * 1024 / sizeof(W_)),
(peak_mblocks_allocated * BLOCKS_PER_MBLOCK * BLOCK_SIZE_W - hw_alloc_blocks * BLOCK_SIZE_W) / (1024 * 1024 / sizeof(W_)));
......@@ -721,7 +721,7 @@ stat_exit(int alloc)
sparks.fizzled += capabilities[i].spark_stats.fizzled;
}
statsPrintf(" SPARKS: %ld (%ld converted, %ld overflowed, %ld dud, %ld GC'd, %ld fizzled)\n\n",
statsPrintf(" SPARKS: %" FMT_Word " (%" FMT_Word " converted, %" FMT_Word " overflowed, %" FMT_Word " dud, %" FMT_Word " GC'd, %" FMT_Word " fizzled)\n\n",
sparks.created + sparks.dud + sparks.overflowed,
sparks.converted, sparks.overflowed, sparks.dud,
sparks.gcd, sparks.fizzled);
......@@ -896,17 +896,18 @@ statDescribeGens(void)
gen_blocks += gcThreadLiveBlocks(i,g);
}
debugBelch("%5d %7ld %9d", g, (lnat)gen->max_blocks, mut);
debugBelch("%5d %7" FMT_SizeT " %9d", g, (lnat)gen->max_blocks, mut);
gen_slop = gen_blocks * BLOCK_SIZE_W - gen_live;
debugBelch("%8ld %8d %8ld %8ld\n", gen_blocks, lge,
debugBelch("%8" FMT_SizeT " %8d %8" FMT_SizeT " %8" FMT_SizeT "\n", gen_blocks, lge,
gen_live*sizeof(W_), gen_slop*sizeof(W_));
tot_live += gen_live;
tot_slop += gen_slop;
}
debugBelch("----------------------------------------------------------\n");
debugBelch("%41s%8ld %8ld\n","",tot_live*sizeof(W_),tot_slop*sizeof(W_));
debugBelch("%41s%8" FMT_SizeT " %8" FMT_SizeT "\n",
"",tot_live*sizeof(W_),tot_slop*sizeof(W_));
debugBelch("----------------------------------------------------------\n");
debugBelch("\n");
}
......
......@@ -64,7 +64,7 @@ Time stat_getElapsedTime(void);
/* Only exported for Papi.c */
void statsPrintf( char *s, ... )
GNUC3_ATTRIBUTE(format (printf, 1, 2));
GNUC3_ATTRIBUTE(format (gnu_printf, 1, 2));
#include "EndPrivate.h"
......
......@@ -320,7 +320,7 @@ discardTasksExcept (Task *keep)
for (task = all_tasks; task != NULL; task=next) {
next = task->all_next;
if (task != keep) {
debugTrace(DEBUG_sched, "discarding task %ld", (long)TASK_ID(task));
debugTrace(DEBUG_sched, "discarding task %" FMT_SizeT "", (size_t)TASK_ID(task));
freeTask(task);
}
}
......@@ -393,7 +393,7 @@ workerTaskStop (Task *task)
static void *taskId(Task *task)
{
#ifdef THREADED_RTS
return (void *)task->id;
return (void *)(size_t)task->id;
#else
return (void *)task;
#endif
......
......@@ -217,7 +217,7 @@ PrintTickyInfo(void)
fprintf(tf,"%7ld (%5.1f%%) normal indirections\n",
tot_ind_enters,
PC(INTAVG(tot_ind_enters,tot_enters)));
fprintf(tf,"%7ld (%5.1f%%) permanent indirections\n",
fprintf(tf,"%7" FMT_Int " (%5.1f%%) permanent indirections\n",
ENT_PERM_IND_ctr,
PC(INTAVG(ENT_PERM_IND_ctr,tot_enters)));
......@@ -228,13 +228,13 @@ PrintTickyInfo(void)
tot_tail_calls, tot_known_calls,
PC(INTAVG(tot_known_calls,tot_tail_calls)));
fprintf(tf, "\nSLOW APPLICATIONS: %ld evaluated, %ld unevaluated\n",
fprintf(tf, "\nSLOW APPLICATIONS: %" FMT_Int " evaluated, %" FMT_Int " unevaluated\n",
SLOW_CALL_ctr, SLOW_CALL_UNEVALD_ctr);
fprintf(tf, "\n");
fprintf(tf, " Too few args Correct args Too many args\n");
fprintf(tf, " FUN %8ld %8ld %8ld\n",
fprintf(tf, " FUN %8" FMT_Int " %8" FMT_Int " %8" FMT_Int "\n",
SLOW_CALL_FUN_TOO_FEW_ctr, SLOW_CALL_FUN_CORRECT_ctr, SLOW_CALL_FUN_TOO_MANY_ctr);
fprintf(tf, " PAP %8ld %8ld %8ld\n",
fprintf(tf, " PAP %8" FMT_Int " %8" FMT_Int " %8" FMT_Int "\n",
SLOW_CALL_PAP_TOO_FEW_ctr, SLOW_CALL_PAP_CORRECT_ctr, SLOW_CALL_PAP_TOO_MANY_ctr);
fprintf(tf, "\n");
......@@ -261,27 +261,27 @@ PrintTickyInfo(void)
fprintf(tf, "\n");