From 1193fbaadf89febd606e1284dbedabdab213ccaa Mon Sep 17 00:00:00 2001 From: Pekka Pirinen Date: Fri, 24 Oct 1997 19:59:46 +0100 Subject: [PATCH] Move vc++ warning suppressions elsewhere Copied from Perforce Change: 18919 ServerID: perforce.ravenbrook.com --- mps/src/check.h | 21 ++------------------- mps/src/mps.h | 12 +++++++----- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/mps/src/check.h b/mps/src/check.h index 604cced1327..a763e810ad0 100644 --- a/mps/src/check.h +++ b/mps/src/check.h @@ -1,6 +1,6 @@ /* impl.h.check: ASSERTION INTERFACE * - * $HopeName: MMsrc!check.h(trunk.5) $ + * $HopeName: MMsrc!check.h(trunk.6) $ * * This header defines a family of AVER and NOTREACHED macros. The * macros should be used to instrument and annotate code with @@ -59,17 +59,13 @@ extern void AssertFail(const char *cond, const char *id, AssertFail(#cond, FileSrcIdStruct.hopename, \ FileSrcIdStruct.file, __LINE__); \ END -/* Disable warning about unreachable code (AssertFail is unreachable, */ -/* if cond is constantly true). */ -#ifdef MPS_BUILD_MV -#pragma warning(disable: 4702) -#endif /* MPS_BUILD_MV */ #define NOCHECK(cond) \ BEGIN \ (void)sizeof(cond); \ END + #define NOTREACHED \ BEGIN \ @@ -86,7 +82,6 @@ extern void AssertFail(const char *cond, const char *id, END - /* CHECKT -- check type simply * * Must be thread safe. See design.mps.interface.c.thread-safety @@ -185,17 +180,5 @@ extern void AssertFail(const char *cond, const char *id, #error "No heat defined." #endif -/* MSVC 2.0 generates a warning when using NOCHECK */ -#if defined(MPS_HOT_RED) || defined(MPS_HOT_WHITE) -#ifdef MPS_BUILD_MV -#ifdef _MSC_VER -#if _MSC_VER < 1000 -#pragma warning(disable: 4705) -#endif /* _MSC_VER < 1000 */ -#else /* _MSC_VER */ -#error "Expected _MSC_VER to be defined for builder.mv" -#endif /* _MSC_VER */ -#endif /* MPS_BUILD_MV */ -#endif /* MPS_HOT_RED || MPS_HOT_WHITE */ #endif /* check_h */ diff --git a/mps/src/mps.h b/mps/src/mps.h index fe924f0b402..38f8397215f 100644 --- a/mps/src/mps.h +++ b/mps/src/mps.h @@ -1,6 +1,6 @@ /* impl.h.mps: HARLEQUIN MEMORY POOL SYSTEM C INTERFACE * - * $HopeName: MMsrc!mps.h(trunk.27) $ + * $HopeName: MMsrc!mps.h(trunk.28) $ * Copyright (C) 1997 The Harlequin Group Limited. All rights reserved. * * .readership: customers, MPS developers. @@ -148,10 +148,12 @@ typedef struct mps_fmt_A_s { #define MPS_BEGIN do { #define MPS_END } while(0) -/* Disable warning about constant conditionals */ -#ifdef MPS_BUILD_MV -#pragma warning(disable: 4127) -#endif +/* MPS_END might cause compiler warnings about constant conditionals. + * This could be avoided with some loss of efficiency by replacing 0 + * with a variable always guaranteed to be 0. In Visual C, the + * warning can be turned off using: + * #pragma warning(disable: 4127) + */ extern mps_res_t mps_ap_fill(mps_addr_t *, mps_ap_t, size_t); extern mps_bool_t mps_ap_trip(mps_ap_t, mps_addr_t, size_t);