From ae64513044e8b79f0589a66739fd778de2311d9b Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 12 Jul 2019 22:34:44 +0400 Subject: [PATCH] FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_platform.h --- src/include/switch_platform.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/include/switch_platform.h b/src/include/switch_platform.h index 005378d392..233caa7c8b 100644 --- a/src/include/switch_platform.h +++ b/src/include/switch_platform.h @@ -337,8 +337,12 @@ SWITCH_END_EXTERN_C #define TRUE (!FALSE) #endif #ifndef switch_assert +#ifdef PVS_STUDIO // Mute PVS FALSE ALARM +#define switch_assert(expr) do {if (!(expr)) {fprintf(stderr, "MEMERR\n"); abort();}} while (0) +#else #define switch_assert(expr) assert(expr) #endif +#endif #ifndef __ATTR_SAL /* used for msvc code analysis */ /* http://msdn2.microsoft.com/en-us/library/ms235402.aspx */