Uninitialized variable usage warning broken

Bug #420129 reported by Ben Gamari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-4.4 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: gcc-4.4

Compiling the attached testcase should produce a warning, as it does with g++
4.3.2 (at least with -O or above),

  $ g++-4.3 -Wall -Wextra -pedantic -ansi -O3 hi.cpp
  /usr/include/bits/stdio2.h: In function ‘int main()’:
  /usr/include/bits/stdio2.h:105: warning: ‘hi.array<double, 4>::a[1]’ is used
  uninitialized in this function
  hi.cpp:29: note: ‘hi.array<double, 4>::a[1]’ was declared here
  $

On g++ 4.4.1, however, the compiler produces no warning,

  $ g++ -Wall -Wextra -pedantic -ansi -O3 hi.cpp
  $

$ g++ -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-1ubuntu3'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-objc-gc
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-1ubuntu3)

Revision history for this message
Ben Gamari (bgamari) wrote :
Revision history for this message
Ben Gamari (bgamari) wrote :

It seems that this is an Ubuntu-specific bug. It was originally reported in the gcc bugzilla as #41135 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41135).

Revision history for this message
Matthias Klose (doko) wrote :

not seen anymore with 4.4.1-4ubuntu1 in karmic

Changed in gcc-4.4 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.