public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41135]  New: Uninitialized variable usage warning broken
@ 2009-08-20 23:25 bgamari at gmail dot com
  2009-08-20 23:26 ` [Bug c++/41135] " bgamari at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bgamari at gmail dot com @ 2009-08-20 23:25 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]

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.2, 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)


-- 
           Summary: Uninitialized variable usage warning broken
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bgamari at gmail dot com
GCC target triplet: x86_64-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41135


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/41135] Uninitialized variable usage warning broken
  2009-08-20 23:25 [Bug c++/41135] New: Uninitialized variable usage warning broken bgamari at gmail dot com
@ 2009-08-20 23:26 ` bgamari at gmail dot com
  2009-08-21  9:56 ` redi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bgamari at gmail dot com @ 2009-08-20 23:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bgamari at gmail dot com  2009-08-20 23:26 -------
Created an attachment (id=18408)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18408&action=view)
Warning test case


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41135


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/41135] Uninitialized variable usage warning broken
  2009-08-20 23:25 [Bug c++/41135] New: Uninitialized variable usage warning broken bgamari at gmail dot com
  2009-08-20 23:26 ` [Bug c++/41135] " bgamari at gmail dot com
@ 2009-08-21  9:56 ` redi at gcc dot gnu dot org
  2009-08-25 13:45 ` bangerth at gmail dot com
  2009-08-27 19:49 ` bgamari at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu dot org @ 2009-08-21  9:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from redi at gcc dot gnu dot org  2009-08-21 09:56 -------
I get the warning with FSF 4.4.1 and the 4.5.0 20090813 snapshot, looks like a
problem with ubuntu's 4.4.1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41135


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/41135] Uninitialized variable usage warning broken
  2009-08-20 23:25 [Bug c++/41135] New: Uninitialized variable usage warning broken bgamari at gmail dot com
  2009-08-20 23:26 ` [Bug c++/41135] " bgamari at gmail dot com
  2009-08-21  9:56 ` redi at gcc dot gnu dot org
@ 2009-08-25 13:45 ` bangerth at gmail dot com
  2009-08-27 19:49 ` bgamari at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at gmail dot com @ 2009-08-25 13:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from bangerth at gmail dot com  2009-08-25 13:45 -------
Agreed -- I do get the warning from current mainline as well.


-- 

bangerth at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at gmail dot com
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41135


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/41135] Uninitialized variable usage warning broken
  2009-08-20 23:25 [Bug c++/41135] New: Uninitialized variable usage warning broken bgamari at gmail dot com
                   ` (2 preceding siblings ...)
  2009-08-25 13:45 ` bangerth at gmail dot com
@ 2009-08-27 19:49 ` bgamari at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: bgamari at gmail dot com @ 2009-08-27 19:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from bgamari at gmail dot com  2009-08-27 19:49 -------
This was reported against the Ubuntu package as Launchpad bug #420129
(https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/420129)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41135


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-27 19:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-20 23:25 [Bug c++/41135] New: Uninitialized variable usage warning broken bgamari at gmail dot com
2009-08-20 23:26 ` [Bug c++/41135] " bgamari at gmail dot com
2009-08-21  9:56 ` redi at gcc dot gnu dot org
2009-08-25 13:45 ` bangerth at gmail dot com
2009-08-27 19:49 ` bgamari at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).