[cfe-dev] Why does scan-build disable check for uninit values?

Ted Kremenek kremenek at apple.com
Fri Jan 2 13:43:44 PST 2009


On Jan 2, 2009, at 2:18 AM, Cristian Draghici wrote:

> Hi
>
> I've noticed that scan-build in the latest version of the checker  
> (137) disables the check for uninit values (-warn-uninit-values).
> Is there a reason behind that?
>
>
> Thank you,
> Cristi

In the static analyzer, checking for uninitialized values, just as  
with checking for null dereferences, is done as part of the core path- 
sensitive logic used for -checker-cfref and -checker-simple.  It isn't  
controlled by -warn-uninit-values.

The -warn-uninit-values option performs a fast check for uses of  
uninitialized values that is similar to GCC's -Wuninitialized.  It  
should be thought of as a cheap check that can be used (one day) as a  
compiler warning rather than a deep check done by the static  
analyzer.  The checking for uninitialized values done by the static  
analyzer is far more precise.

Some of these options should probably be renamed to avoid such  
confusion.



More information about the cfe-dev mailing list