
Tim Peters <tim.peters@gmail.com> wrote:
[Thomas Wouters]
I noticed a few compiler warnings, when I compile Python on my amd64 with gcc 4.0.3:
Objects/longobject.c: In function 'PyLong_AsDouble': Objects/longobject.c:655: warning: 'e' may be used uninitialized in this function
Well, that's pretty bizarre. There's _obviously_ no way to get to a reference to `e` without going through
x = _PyLong_AsScaledDouble(vv, &e);
first. That isn't a useful warning.
This has been discussed many times on the GCC mailing list. Ultimately, detecting whether a variable is using initialized or not (given full interprocedural and whole-program compilation) is a problem that can be reduced to the halting problem. The only thing that GCC should (and will) do is finding a way to be consistent across different releases and optimization levels, and to produce an useful number of warnings, while not issuing too many false positives. -- Giovanni Bajo