[cfe-commits] r124279 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Preprocessor/pragma_diagnostic_sections.cpp test/Sema/uninit-variables.c test/SemaCXX/uninit-variables.cpp

Chris Lattner clattner at apple.com
Wed Feb 2 14:47:30 PST 2011


On Jan 31, 2011, at 8:39 AM, Ted Kremenek wrote:

> 
> I'll be honest that I'm concerned that we can make -Wuninitialized work in Clang with the same expectations that people have with GCC's implementation. Since GCC's implementation depends on its backend optimizer, it gets a whole bunch of "smarts" for free when it comes to control-dependencies (although I suspect in many cases GCC just gives up, and conservatively not warn).  The static analyzer can easily reason about control-dependencies, but that inherently makes the dataflow analysis much more expensive (and non-linear).  Replicating some subset of that functionality in -Wuninitialized is not going to be cheap.

There is also a serious cost to GCC's warning: it is unstable across versions of the compiler.  I think it is better for -Wuninitialized to be simple (fast), predictable, and stable across the compiler versions.  If you want a theorem prover, look to the static analyzer :)

-Chris



More information about the cfe-commits mailing list