From: Andrey Volk Date: Fri, 12 Jul 2019 18:34:44 +0000 (+0400) Subject: FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_platform.h X-Git-Tag: v1.10.0~232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae64513044e8b79f0589a66739fd778de2311d9b;p=thirdparty%2Ffreeswitch.git FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_platform.h --- 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 */