Re: Static Analysis of PHP_5_4 with CLANG

From: Date: Sun, 05 Feb 2012 23:04:27 +0000
Subject: Re: Static Analysis of PHP_5_4 with CLANG
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-57753@lists.php.net to get a copy of this message
On Sun, 05 Feb 2012 14:08:17 -0800, Stas Malyshev wrote:
Another thing - is there any way to give CLANG some hints about some functions - such as the fact that zend_error(E_ERROR) does not return or just make some exceptions when we know some situation that it thinks can happen does not in fact happen - such as revtal_ptr_ptr = &retval_ptr and then passing retval_ptr_ptr would actually change retval_ptr somewhere on the way, etc. The idea is if we could weed out false positives and somehow mark them we could use this tool in CI for detecting real errors.
Perhaps those instances could be replaced by zend_error_noreturn. That variant has the "noreturn" attribute, which signals the function never returns. This useful for suppressing those kind of warnings (note C11 also added a standard __Noreturn). -- Gustavo Lopes

« previous php.internals (#57753) next »