From 9027f860224f5a68ceb9344af4370be9b9d2e591 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Fri, 5 Jan 2024 15:37:44 +0000 Subject: [PATCH] Refine warning pragmas, and make it possible to revert to all warnings (e.g. in order to fix them!) --- src/common/sysutils.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/sysutils.h b/src/common/sysutils.h index 1dba434..53a771e 100644 --- a/src/common/sysutils.h +++ b/src/common/sysutils.h @@ -45,15 +45,18 @@ # define R__ #endif -#ifdef _MSC_VER +#ifndef RUBBERBAND_ENABLE_WARNINGS +#if defined(_MSC_VER) #pragma warning(disable:4127; disable:4244; disable:4267) -#else +#elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wconversion" +#elif defined(__clang__) #pragma clang diagnostic ignored "-Wsign-conversion" #pragma clang diagnostic ignored "-Wfloat-conversion" #pragma clang diagnostic ignored "-Wimplicit-float-conversion" #pragma clang diagnostic ignored "-Wshorten-64-to-32" #endif +#endif #ifdef __clang__ # define RTENTRY__ __attribute__((annotate("realtime")))