[cfe-dev] uninitialized variable warning, etc

Daniel Dunbar daniel at zuster.org
Fri Mar 6 12:21:35 PST 2009


Hi,

clang does not yet implement the uninitialized values warning outside
of the static analysis engine.
--
ddunbar at lordcrumb:tmp$ cat t4.c
int f0(void)  {
  int b;
  return b;
}
ddunbar at lordcrumb:tmp$ ccc --analyze t4.c
t4.c:3:3: warning: Uninitialized or undefined return value returned to caller.
  return b;
  ^
1 diagnostic generated.
--

Feel free to file a bug if you like; however this is the sort of
warning that the static analyzer is much more suited to emitting. We
never want to have the gcc behavior where warnings depend on
optimization level or have warnings emitted by the backend.

On Thu, Mar 5, 2009 at 6:36 PM,  <rdogra at earthlink.net> wrote:
> libavcodec/dsputil.c:3966:10: warning: use of unary operator that may
> be intended as compound assignment (-=)
>    for(i=-len, j=len-1; i<0; i++, j--) {
>         ^~

Yes; we may well end up disabling this warning by default as it
appears to be quite noisy on some code bases.

 - Daniel




More information about the cfe-dev mailing list