diff --git a/mps/code/arenacl.c b/mps/code/arenacl.c index 3d07f529779..1a0fcf3c6e3 100644 --- a/mps/code/arenacl.c +++ b/mps/code/arenacl.c @@ -61,6 +61,7 @@ typedef struct ClientChunkStruct { /* ClientChunkCheck -- check the consistency of a client chunk */ +ATTRIBUTE_UNUSED static Bool ClientChunkCheck(ClientChunk clChunk) { Chunk chunk; @@ -77,6 +78,7 @@ static Bool ClientChunkCheck(ClientChunk clChunk) /* ClientArenaCheck -- check the consistency of a client arena */ +ATTRIBUTE_UNUSED static Bool ClientArenaCheck(ClientArena clientArena) { CHECKS(ClientArena, clientArena); diff --git a/mps/code/arenavm.c b/mps/code/arenavm.c index 81e0684c436..f878092bd01 100644 --- a/mps/code/arenavm.c +++ b/mps/code/arenavm.c @@ -93,6 +93,7 @@ static void VMCompact(Arena arena, Trace trace); /* VMChunkCheck -- check the consistency of a VM chunk */ +ATTRIBUTE_UNUSED static Bool VMChunkCheck(VMChunk vmchunk) { Chunk chunk; @@ -152,6 +153,7 @@ static Bool VMChunkCheck(VMChunk vmchunk) /* VMArenaCheck -- check the consistency of an arena structure */ +ATTRIBUTE_UNUSED static Bool VMArenaCheck(VMArena vmArena) { Arena arena; diff --git a/mps/code/buffer.c b/mps/code/buffer.c index bbae1f3eacd..a6cb2bee187 100644 --- a/mps/code/buffer.c +++ b/mps/code/buffer.c @@ -994,6 +994,7 @@ AllocPattern AllocPatternRampCollectAll(void) return &AllocPatternRampCollectAllStruct; } +ATTRIBUTE_UNUSED static Bool AllocPatternCheck(AllocPattern pattern) { CHECKL(pattern == &AllocPatternRampCollectAllStruct diff --git a/mps/code/cbs.c b/mps/code/cbs.c index 118d226a603..addebd398ad 100644 --- a/mps/code/cbs.c +++ b/mps/code/cbs.c @@ -80,6 +80,7 @@ Bool CBSCheck(CBS cbs) } +ATTRIBUTE_UNUSED static Bool CBSBlockCheck(CBSBlock block) { /* See .enter-leave.simple. */ diff --git a/mps/code/config.h b/mps/code/config.h index 0afa66c06bb..c07f646a0af 100644 --- a/mps/code/config.h +++ b/mps/code/config.h @@ -241,6 +241,15 @@ #define ATTRIBUTE_NORETURN #endif +/* Attribute for functions that may be unused in some build configurations. + * GCC: + */ +#if defined(MPS_BUILD_GC) || defined(MPS_BUILD_LL) +#define ATTRIBUTE_UNUSED __attribute__((__unused__)) +#else +#define ATTRIBUTE_UNUSED +#endif + /* EPVMDefaultSubsequentSegSIZE is a default for the alignment of * subsequent segments (non-initial at each save level) in EPVM. See diff --git a/mps/code/freelist.c b/mps/code/freelist.c index 6260451ff59..1abc3f73cc8 100644 --- a/mps/code/freelist.c +++ b/mps/code/freelist.c @@ -1,7 +1,7 @@ /* freelist.c: FREE LIST ALLOCATOR IMPLEMENTATION * * $Id$ - * Copyright (c) 2013 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2013-2014 Ravenbrook Limited. See end of file for license. * * .sources: . */ @@ -60,6 +60,7 @@ static Addr FreelistBlockLimit(Freelist fl, FreelistBlock block) /* FreelistBlockCheck -- check a block. */ +ATTRIBUTE_UNUSED static Bool FreelistBlockCheck(FreelistBlock block) { CHECKL(block != NULL); @@ -626,7 +627,7 @@ void FreelistFlushToCBS(Freelist fl, CBS cbs) /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2013 Ravenbrook Limited . + * Copyright (C) 2013-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/locus.c b/mps/code/locus.c index 6e6e22128b7..10eae03840f 100644 --- a/mps/code/locus.c +++ b/mps/code/locus.c @@ -80,6 +80,7 @@ void SegPrefExpress(SegPref pref, SegPrefKind kind, void *p) /* GenDescCheck -- check a GenDesc */ +ATTRIBUTE_UNUSED static Bool GenDescCheck(GenDesc gen) { CHECKS(GenDesc, gen); diff --git a/mps/code/mpsi.c b/mps/code/mpsi.c index 45ffff50166..f4e3f9e6f02 100644 --- a/mps/code/mpsi.c +++ b/mps/code/mpsi.c @@ -65,6 +65,7 @@ SRCID(mpsi, "$Id$"); * .check.enum.cast: enum comparisons have to be cast to avoid a warning * from the SunPro C compiler. See builder.sc.warn.enum. */ +ATTRIBUTE_UNUSED static Bool mpsi_check(void) { CHECKL(COMPATTYPE(mps_res_t, Res)); diff --git a/mps/code/poolamc.c b/mps/code/poolamc.c index aeb04454efe..6ae51fc4fe6 100644 --- a/mps/code/poolamc.c +++ b/mps/code/poolamc.c @@ -96,6 +96,7 @@ typedef struct amcSegStruct { #define amcSeg2Seg(amcseg) ((Seg)(amcseg)) +ATTRIBUTE_UNUSED static Bool amcSegCheck(amcSeg amcseg) { CHECKS(amcSeg, amcseg); @@ -475,6 +476,7 @@ typedef struct AMCStruct { /* */ /* amcGenCheck -- check consistency of a generation structure */ +ATTRIBUTE_UNUSED static Bool amcGenCheck(amcGen gen) { Arena arena; @@ -524,6 +526,7 @@ typedef struct amcBufStruct { /* amcBufCheck -- check consistency of an amcBuf */ +ATTRIBUTE_UNUSED static Bool amcBufCheck(amcBuf amcbuf) { CHECKS(amcBuf, amcbuf); @@ -2445,6 +2448,8 @@ void mps_amc_apply(mps_pool_t mps_pool, * * See . */ + +ATTRIBUTE_UNUSED static Bool AMCCheck(AMC amc) { CHECKS(AMC, amc); diff --git a/mps/code/poolawl.c b/mps/code/poolawl.c index cbece0b41fe..21edaaec1cb 100644 --- a/mps/code/poolawl.c +++ b/mps/code/poolawl.c @@ -131,6 +131,7 @@ typedef struct AWLSegStruct { extern SegClass AWLSegClassGet(void); +ATTRIBUTE_UNUSED static Bool AWLSegCheck(AWLSeg awlseg) { CHECKS(AWLSeg, awlseg); @@ -1299,6 +1300,7 @@ mps_class_t mps_class_awl(void) /* AWLCheck -- check an AWL pool */ +ATTRIBUTE_UNUSED static Bool AWLCheck(AWL awl) { CHECKS(AWL, awl); diff --git a/mps/code/poollo.c b/mps/code/poollo.c index d8f23584fba..3420e22b9ab 100644 --- a/mps/code/poollo.c +++ b/mps/code/poollo.c @@ -79,6 +79,7 @@ DEFINE_SEG_CLASS(LOSegClass, class) /* LOSegCheck -- check an LO segment */ +ATTRIBUTE_UNUSED static Bool LOSegCheck(LOSeg loseg) { CHECKS(LOSeg, loseg); @@ -184,6 +185,7 @@ static void loSegFinish(Seg seg) } +ATTRIBUTE_UNUSED static Count loSegBits(LOSeg loseg) { LO lo; @@ -805,6 +807,7 @@ mps_class_t mps_class_lo(void) /* LOCheck -- check an LO pool */ +ATTRIBUTE_UNUSED static Bool LOCheck(LO lo) { CHECKS(LO, lo); diff --git a/mps/code/poolmrg.c b/mps/code/poolmrg.c index 93d9f8bd25e..ace97865f1b 100644 --- a/mps/code/poolmrg.c +++ b/mps/code/poolmrg.c @@ -125,6 +125,7 @@ typedef struct MRGStruct { /* MRGCheck -- check an MRG pool */ +ATTRIBUTE_UNUSED static Bool MRGCheck(MRG mrg) { CHECKS(MRG, mrg); @@ -178,6 +179,8 @@ extern SegClass MRGRefSegClassGet(void); * field will be NULL. This will be initialized when the reference * segment is initialized. See . */ + +ATTRIBUTE_UNUSED static Bool MRGLinkSegCheck(MRGLinkSeg linkseg) { Seg seg; @@ -193,6 +196,7 @@ static Bool MRGLinkSegCheck(MRGLinkSeg linkseg) return TRUE; } +ATTRIBUTE_UNUSED static Bool MRGRefSegCheck(MRGRefSeg refseg) { Seg seg; diff --git a/mps/code/poolmv.c b/mps/code/poolmv.c index 0ce4f28c95d..ccce962e42a 100644 --- a/mps/code/poolmv.c +++ b/mps/code/poolmv.c @@ -72,6 +72,7 @@ typedef struct MVBlockStruct { /* MVBlockCheck -- check the consistency of a block structure */ +ATTRIBUTE_UNUSED static Bool MVBlockCheck(MVBlock block) { AVER(block != NULL); @@ -130,6 +131,7 @@ typedef struct MVSpanStruct { /* MVSpanCheck -- check the consistency of a span structure */ +ATTRIBUTE_UNUSED static Bool MVSpanCheck(MVSpan span) { Addr addr, base, limit; diff --git a/mps/code/poolmv2.c b/mps/code/poolmv2.c index f6d85b1b134..b4ac6913fdf 100644 --- a/mps/code/poolmv2.c +++ b/mps/code/poolmv2.c @@ -356,6 +356,7 @@ failCBS: /* MVTCheck -- validate an MVT Pool */ +ATTRIBUTE_UNUSED static Bool MVTCheck(MVT mvt) { CHECKS(MVT, mvt); diff --git a/mps/code/poolmvff.c b/mps/code/poolmvff.c index 4971550c76a..3d569058697 100644 --- a/mps/code/poolmvff.c +++ b/mps/code/poolmvff.c @@ -791,6 +791,7 @@ size_t mps_mvff_size(mps_pool_t mps_pool) /* MVFFCheck -- check the consistency of an MVFF structure */ +ATTRIBUTE_UNUSED static Bool MVFFCheck(MVFF mvff) { CHECKS(MVFF, mvff); diff --git a/mps/code/poolsnc.c b/mps/code/poolsnc.c index e9afe98a96b..139865fc5ec 100644 --- a/mps/code/poolsnc.c +++ b/mps/code/poolsnc.c @@ -84,6 +84,7 @@ typedef struct SNCBufStruct { /* SNCBufCheck -- check consistency of an SNCBuf */ +ATTRIBUTE_UNUSED static Bool SNCBufCheck(SNCBuf sncbuf) { SegBuf segbuf; @@ -214,6 +215,7 @@ typedef struct SNCSegStruct { #define sncSegSetNext(seg, nextseg) \ ((void)(SegSNCSeg(seg)->next = SegSNCSeg(nextseg))) +ATTRIBUTE_UNUSED static Bool SNCSegCheck(SNCSeg sncseg) { CHECKS(SNCSeg, sncseg); @@ -696,6 +698,7 @@ mps_class_t mps_class_snc(void) /* SNCCheck -- Check an SNC pool */ +ATTRIBUTE_UNUSED static Bool SNCCheck(SNC snc) { CHECKS(SNC, snc); diff --git a/mps/code/reserv.c b/mps/code/reserv.c index 02b18d66d88..c7dd0507482 100644 --- a/mps/code/reserv.c +++ b/mps/code/reserv.c @@ -107,6 +107,7 @@ Bool ReservoirCheck(Reservoir reservoir) /* reservoirIsConsistent -- returns FALSE if the reservoir is corrupt */ +ATTRIBUTE_UNUSED static Bool reservoirIsConsistent(Reservoir reservoir) { Size alignment, size = 0; diff --git a/mps/code/sac.c b/mps/code/sac.c index 3caf9ab893f..c85956c8f82 100644 --- a/mps/code/sac.c +++ b/mps/code/sac.c @@ -32,6 +32,7 @@ static Bool sacFreeListBlockCheck(SACFreeListBlock fb) return TRUE; } +ATTRIBUTE_UNUSED static Bool SACCheck(SAC sac) { Index i, j; diff --git a/mps/code/segsmss.c b/mps/code/segsmss.c index 978c352e0dd..7efac5c64a5 100644 --- a/mps/code/segsmss.c +++ b/mps/code/segsmss.c @@ -59,6 +59,7 @@ typedef struct AMSTStruct *AMST; /* AMSTCheck -- the check method for an AMST */ +ATTRIBUTE_UNUSED static Bool AMSTCheck(AMST amst) { CHECKS(AMST, amst); @@ -96,6 +97,7 @@ typedef struct AMSTSegStruct { /* AMSTSegCheck -- check the AMST segment */ +ATTRIBUTE_UNUSED static Bool AMSTSegCheck(AMSTSeg amstseg) { CHECKS(AMSTSeg, amstseg); diff --git a/mps/code/walk.c b/mps/code/walk.c index 4dd0d6b9e98..544c9644498 100644 --- a/mps/code/walk.c +++ b/mps/code/walk.c @@ -26,6 +26,7 @@ typedef struct FormattedObjectsStepClosureStruct { } FormattedObjectsStepClosureStruct; +ATTRIBUTE_UNUSED static Bool FormattedObjectsStepClosureCheck(FormattedObjectsStepClosure c) { CHECKS(FormattedObjectsStepClosure, c); @@ -164,6 +165,7 @@ typedef struct rootsStepClosureStruct { /* rootsStepClosureCheck -- check a rootsStepClosure */ +ATTRIBUTE_UNUSED static Bool rootsStepClosureCheck(rootsStepClosure rsc) { CHECKS(rootsStepClosure, rsc);