Kevin Grittner <kgrittn@ymail.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Kevin Grittner <kgrittn@ymail.com> writes:
>>> � I don't get a warning on this with either of these compilers,
>>> � either with or without asserts enabled:
>> Perhaps you built with -O0?� At least in older versions of gcc, you need
>> at least -O1 to get uninitialized-variable warnings.
> This is with default configure and compile options, which results
> in this:
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
-Wmissing-format-attribute-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g
-I../../../../src/include-D_GNU_SOURCE -I/usr/include/libxml2�� -c -o rowtypes.o rowtypes.c -MMD -MP -MF
.deps/rowtypes.Po
> ... It is pretty disturbing that the compilers in my
> Linux distro don't recognize that as leaving the value
> uninitialized.
That is a serious compiler bug which you should file with your distro
forthwith. It definitely does show up with what I'm using:
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
It might be worth trawling the buildfarm records to see which compilers
did or didn't warn before.
regards, tom lane