Closed llvmbot closed 11 years ago
The analyzer is conservative about global variables, even static global variables, and assumes that any function calls it sees could change the variable. IPA mitigates this a bit, and there are techniques we could add to figure out that a particular function does /not/ touch a global, but in the general case it's an unsolvable problem. I don't think we're going to be able to fix this any time soon.
Workaround: cache the results of the check in a local variable.
Preprocessed output of tshark.c The preprocessed version of tshark.c
Created by appending -save-temps to the CFLAGS in the makefile.
Can you please attach a preprocessed version of tshark.c, so we can try to reproduce the problem under roughly the same configuration?
assigned to @tkremenek
Extended Description
Tested with clang r184521 on Ubuntu 13.04, x86.
Clang claims that one of the arguments of a function call is uninitialized.
However, it only reaches that code path after:
"Assuming 'do_dissection' is 0", and "Assuming 'do_dissection' is not equal to 0",
with no usage or access of do_dissection in between.
do_dissection is a "static gboolean", and if you examine the docs:
( http://svn.abisource.com/wv/tags/release-version-0-7-11/glib-wv/glib.h )
typedef int gint; typedef gint gboolean;
So to my understanding, a gboolean is effectively an int.
The attached file is tshark.c from wireshark r50104.