Dan H. wrote:
If you tell me what options you build with and I can reproduce the warning then I'll be more than happy to try to fix it. I build widl with -W -Wall and get two warnings.
To get uninitialized warnings, you have to also specify optimization (-O2). Without -O, gcc doesn't do the analysis that can detect uninitialized variables. - Dan
On Sun, Oct 28, 2007 at 07:07:15PM -0700, Dan Kegel wrote:
To get uninitialized warnings, you have to also specify optimization (-O2). Without -O, gcc doesn't do the analysis that can detect uninitialized variables.
Compiling with "-O2 -W -Wall" using either gcc 4.0 or 3.4 I don't get any warnings. Even adding -Wuninitialized doesn't do anything:
$ make clean && make -j1 CFLAGS="-O2 -W -Wall -Wuninitialized" 2>&1 | fgrep warning widl.c:189: warning: unused parameter 'sig' parser.yy.c:1276: warning: comparison between signed and unsigned
On Mon, 29 Oct 2007, Dan Hipschman wrote:
Compiling with "-O2 -W -Wall" using either gcc 4.0 or 3.4 I don't get any warnings. Even adding -Wuninitialized doesn't do anything:
I am mostly using GCC 3.4 with -O2 -Wall as you did, and occasionally a snapshot of GCC 4.3, with and without -Wextra in addition. It took me a bit to find the combination that triggered it, and it is
GCC 4.3.0 20071029 with -O2 -Wall -Wextra
that issues
typegen.c: In function 'get_required_buffer_size_type': typegen.c:2288: warning: 'uname' may be used uninitialized in this function typegen.c: In function 'write_user_tfs': typegen.c:953: warning: 'name' may be used uninitialized in this function
Gerald