public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/36866] New: lack of warning when initializing a class member from an uninitialized variable
@ 2008-07-17 19:15 pentek dot imre at gmail dot com
2008-07-17 19:16 ` [Bug c++/36866] " pentek dot imre at gmail dot com
2008-07-21 14:31 ` manu at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: pentek dot imre at gmail dot com @ 2008-07-17 19:15 UTC (permalink / raw)
To: gcc-bugs
Hello, the attached code compiles without any warning when compiled with the
command
g++ -W -Wall any.cpp -c -o any.o
but x gets initialised from itself, actually dereferencing x prior to
initializing it. At this point it is trivial that x wasn't initialised.
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --enable-multilib --enable-libmudflap
--disable-libssp --enable-java-awt=gtk
--enable-languages=c,c++,java,treelang,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2 p1.1)
--
Summary: lack of warning when initializing a class member from an
uninitialized variable
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pentek dot imre at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36866
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/36866] lack of warning when initializing a class member from an uninitialized variable
2008-07-17 19:15 [Bug c++/36866] New: lack of warning when initializing a class member from an uninitialized variable pentek dot imre at gmail dot com
@ 2008-07-17 19:16 ` pentek dot imre at gmail dot com
2008-07-21 14:31 ` manu at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pentek dot imre at gmail dot com @ 2008-07-17 19:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pentek dot imre at gmail dot com 2008-07-17 19:16 -------
Created an attachment (id=15925)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15925&action=view)
any.cpp
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36866
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/36866] lack of warning when initializing a class member from an uninitialized variable
2008-07-17 19:15 [Bug c++/36866] New: lack of warning when initializing a class member from an uninitialized variable pentek dot imre at gmail dot com
2008-07-17 19:16 ` [Bug c++/36866] " pentek dot imre at gmail dot com
@ 2008-07-21 14:31 ` manu at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-07-21 14:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from manu at gcc dot gnu dot org 2008-07-21 14:30 -------
To fix this testcase we would need to fix a few of the -Wuninitialized issues,
since -Wuninitialized does not work without optimisation, we don't handle VOPs
(no -Wunitialized for pointers then), and -Winit-self is broken for some cases.
Nonetheless, fixing PR19808 would be a start.
*** This bug has been marked as a duplicate of 19808 ***
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36866
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-21 14:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-17 19:15 [Bug c++/36866] New: lack of warning when initializing a class member from an uninitialized variable pentek dot imre at gmail dot com
2008-07-17 19:16 ` [Bug c++/36866] " pentek dot imre at gmail dot com
2008-07-21 14:31 ` manu at gcc dot gnu dot org
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).