]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_platform.h
authorAndrey Volk <andywolk@gmail.com>
Fri, 12 Jul 2019 18:34:44 +0000 (22:34 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 15 Jul 2019 19:47:11 +0000 (23:47 +0400)
src/include/switch_platform.h

index 005378d392811305a14039c1d6c380b68f6cbcb6..233caa7c8be530522b21b9814d231513cf8581bb 100644 (file)
@@ -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 */