diff options
author | Anatol Belski <ab@php.net> | 2013-08-23 17:41:07 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2013-08-23 17:41:07 +0200 |
commit | 716fc80fda937bedba786445d6b1854c48af12f8 (patch) | |
tree | 6320581bfe4b3cd6ce8d5f784c8e234868bf8202 | |
parent | 38f9c515cdee7c7c0e1c204ba24027de04e3936e (diff) | |
download | php-git-716fc80fda937bedba786445d6b1854c48af12f8.tar.gz |
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.
-rw-r--r-- | Zend/zend_vm_execute.h | 7 | ||||
-rw-r--r-- | Zend/zend_vm_gen.php | 20 |
2 files changed, 26 insertions, 1 deletions
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 (<non-zero constant> || <expression>) warnings on windows + out($f, "# pragma warning(once : 6235)\n"); + // Suppress (<zero> && <expression>) warnings on windows + out($f, "# pragma warning(once : 6237)\n"); + // Suppress (<non-zero constant> && <expression>) warnings on windows + out($f, "# pragma warning(once : 6239)\n"); + // Suppress (<expression> && <non-zero constant>) warnings on windows + out($f, "# pragma warning(once : 6240)\n"); + // Suppress (<non-zero constant> || <non-zero constant>) warnings on windows + out($f, "# pragma warning(once : 6285)\n"); + // Suppress (<non-zero constant> || <expression>) 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"); |