From 716fc80fda937bedba786445d6b1854c48af12f8 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 23 Aug 2013 17:41:07 +0200 Subject: [PATCH] Suppress static analyzer warnings in specialized executor As things like if(0) will be removed by the compiler, no need to see that tons of warnings with static analyzer enabled. --- Zend/zend_vm_execute.h | 7 +++++++ Zend/zend_vm_gen.php | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index a80d9a453b..2ba6bfef1d 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -20,6 +20,13 @@ #ifdef ZEND_WIN32 # pragma warning(once : 4101) +# pragma warning(once : 6235) +# pragma warning(once : 6237) +# pragma warning(once : 6239) +# pragma warning(once : 6240) +# pragma warning(once : 6285) +# pragma warning(once : 6286) +# pragma warning(once : 6326) #endif static user_opcode_handler_t zend_user_opcode_handlers[256] = { (user_opcode_handler_t)NULL, diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 9a75711478..9b2877b996 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -1189,8 +1189,26 @@ function gen_vm($def, $skel) { // Insert header out($f, $GLOBALS['header_text']); + out($f, "#ifdef ZEND_WIN32\n"); // Suppress free_op1 warnings on Windows - out($f, "#ifdef ZEND_WIN32\n# pragma warning(once : 4101)\n#endif\n"); + out($f, "# pragma warning(once : 4101)\n"); + if (ZEND_VM_SPEC) { + // Suppress ( || ) warnings on windows + out($f, "# pragma warning(once : 6235)\n"); + // Suppress ( && ) warnings on windows + out($f, "# pragma warning(once : 6237)\n"); + // Suppress ( && ) warnings on windows + out($f, "# pragma warning(once : 6239)\n"); + // Suppress ( && ) warnings on windows + out($f, "# pragma warning(once : 6240)\n"); + // Suppress ( || ) warnings on windows + out($f, "# pragma warning(once : 6285)\n"); + // Suppress ( || ) warnings on windows + out($f, "# pragma warning(once : 6286)\n"); + // Suppress constant with constant comparsion warnings on windows + out($f, "# pragma warning(once : 6326)\n"); + } + out($f, "#endif\n"); // Support for ZEND_USER_OPCODE out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n"); -- 2.50.1