https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49508 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |redi at gcc dot gnu.org --- Comment #6 from Jonathan Wakely --- I'm seeing this frequently too, I was about to create a new PR as follows: struct Y { }; struct X { X(short*); }; X f() { int i; return &i; } w.cc: In function ‘X f()’: w.cc:5:24: error: could not convert ‘& i’ from ‘int*’ to ‘X’ X f() { int i; return &i; } ^ w.cc:5:27: warning: control reaches end of non-void function [-Wreturn-type] X f() { int i; return &i; } ^ The warning is useless, because as soon as the error is fixed the warning will go away, so it adds nothing but noise to the output. And it's also confusing because there's a return statement *right* *there*! I can see it and GCC even printed it out! :-) It only reaches the end because GCC decides to ignore the return statement that fails in order to continue compiling the rest of the function. This doesn't happen in all cases where the return statement has an error, e.g. if the example above does return i; instead of return &i; there's no warning. >From gcc-bugs-return-475407-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 29 15:07:31 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 11083 invoked by alias); 29 Jan 2015 15:07:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 10846 invoked by uid 48); 29 Jan 2015 15:07:19 -0000 From: "gerrit.los at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/64717] -fsanitize=vptr leads to warning:=?UTF-8?Q? ‘?==?UTF-8?Q?’ may be used uninitialized in this function ?=[-Wmaybe-uninitialized] Date: Thu, 29 Jan 2015 15:07:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: gerrit.los at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg03401.txt.bz2 Content-length: 832 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64717 Gert-jan Los changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gerrit.los at gmail dot com --- Comment #1 from Gert-jan Los --- Created attachment 34615 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34615&action=edit test case with virtual destructor version: gcc version 5.0.0 20150128 (experimental) (GCC) options: -O -fsanitize=vptr -Werror=uninitialized PostScript_Back_End.C.i: In function ‘void fn1()’: PostScript_Back_End.C.i:8:34: error: ‘’ is used uninitialized in this function [-Werror=uninitialized] >From gcc-bugs-return-475408-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 29 15:09:40 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 14368 invoked by alias); 29 Jan 2015 15:09:38 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 14226 invoked by uid 48); 29 Jan 2015 15:09:30 -0000 From: "gerrit.los at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/64717] -fsanitize=vptr leads to warning:=?UTF-8?Q? ‘?==?UTF-8?Q?’ may be used uninitialized in this function ?=[-Wmaybe-uninitialized] Date: Thu, 29 Jan 2015 15:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: gerrit.los at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg03402.txt.bz2 Content-length: 552 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64717 --- Comment #2 from Gert-jan Los --- Created attachment 34616 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34616&action=edit test case with virtual base class version: gcc version 5.0.0 20150128 (experimental) (GCC) options: -O -fsanitize=vptr -Werror=uninitialized gap_widths.C.i: In function ‘void fn1()’: gap_widths.C.i:13:41: error: ‘’ is used uninitialized in this function [-Werror=uninitialized] >From gcc-bugs-return-475409-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 29 15:09:55 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 14712 invoked by alias); 29 Jan 2015 15:09:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 14492 invoked by uid 48); 29 Jan 2015 15:09:43 -0000 From: "sirl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/64860] New: multiple definition of typeinfo in 5.0 (4.9.2 works) Date: Thu, 29 Jan 2015 15:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sirl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg03403.txt.bz2 Content-length: 2220 https://gcc.gnu.org/bugzilla/show_bug.cgi?idd860 Bug ID: 64860 Summary: multiple definition of typeinfo in 5.0 (4.9.2 works) Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: sirl at gcc dot gnu.org Created attachment 34617 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id4617&actioníit Simple testcase. Use "make" to reproduce. While trying to construct a testcase for a 4.8 to 4.9 change of LTO linking behaviour, I stumbled over this (just re-tested with r220248): g++-5 -flto -fuse-linker-plugin -O2 -Wall -Wextra -c file1.cpp g++-5 -flto -fuse-linker-plugin -O2 -Wall -Wextra -c file2.cpp gcc-5 -flto -fuse-linker-plugin -Wl,-r -nostdlib -o lib1.lib file1.o gcc-5 -flto -fuse-linker-plugin -Wl,-r -nostdlib -o lib2.lib file2.o g++-5 -flto -fuse-linker-plugin -O2 -o testexe lib1.lib lib2.lib lib2.lib:(.rodata+0x0): multiple definition of `typeinfo name for CDialogBase' lib1.lib:(.rodata+0x0): first defined here collect2: error: ld returned 1 exit status # g++-5 -v Using built-in specs. COLLECT_GCC=g++-5 COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/5/lto-wrapper Target: x86_64-suse-linux Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,fortran --with-gxx-include-dir=/usr/include/c++/5 --enable-ssp --disable-libssp --disable-libvtv --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --with-default-libstdcxx-abi=c++98 --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --program-suffix=-5 --without-system-libunwind --enable-multilib --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux Thread model: posix gcc version 5.0.0 20150129 (experimental) (SUSE Linux) gcc-4.8.3 and 4.9.2 compile and link the same code just fine.