On Sun, Feb 5, 2012 at 17:08, Stas Malyshev <smalys...@sugarcrm.com> wrote: > Hi! > > 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.
Clang (and its static analyzer) has a huge number of annotative attributes for everything which can be easily ifdef'd to nothing on non-Clang. <http://clang.llvm.org/docs/LanguageExtensions.html> gives most of them, and Clang also has the (nearly) full range of GCC's attributes. You can also disable the analyzer for non-annotatable false positives with a #if block (I forget the name of the macro off the top of my head). The most recent versions of clang should be able to trace aliased pointer paths to some extent, so if you're getting false positives there, it's possible there's a subtle issue (I haven't looked at the actual output). -- Gwynne -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php