[cfe-dev] uninitialized variable warning, etc

Eli Friedman eli.friedman at gmail.com
Fri Mar 6 14:11:40 PST 2009


On Thu, Mar 5, 2009 at 6:36 PM,  <rdogra at earthlink.net> wrote:
> test.c: In function ‘main’:
> test.c:8: warning: format ‘%s’ expects type ‘char *’, but argument 2

There's a TODO in the code to add this check.

> has type ‘int’
> test.c:7: warning: ‘b’ is used uninitialized in this function

clang doesn't have a warning like this as part of the default
compilation process, at least for the moment.  There is a separate
analysis module which prints warnings like this, though; see
http://clang.llvm.org/StaticAnalysis.html.

> libavcodec/dsputil.c:3966:10: warning: use of unary operator that may
> be intended as compound assignment (-=)

This warning triggers on a lot of stuff... we should probably disable
it by default.

-Eli




More information about the cfe-dev mailing list