From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1062 invoked by alias); 11 Dec 2014 19:09:34 -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 Received: (qmail 1041 invoked by uid 48); 11 Dec 2014 19:09:29 -0000 From: "d.g.gorbachev at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/64275] New: Warnings when linking GCC go1: "(virtual table of) type 'struct X' violates one definition rule" Date: Thu, 11 Dec 2014 19:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: d.g.gorbachev 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter 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: 2014-12/txt/msg01330.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64275 Bug ID: 64275 Summary: Warnings when linking GCC go1: "(virtual table of) type 'struct X' violates one definition rule" Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: d.g.gorbachev at gmail dot com GCC 5.0.0 20141207 (experimental). To reproduce the warnings, GCC and libstdc++ must be compiled with LTO (as in PR59472). /tmp/build/prev-i686-pc-linux-gnu/libstdc++-v3/include/bits/ios_base.h:249:34: warning: type 'struct failure' violates one definition rule [-Wodr] class _GLIBCXX_ABI_TAG_CXX11 failure : public system_error ^ /tmp/build/i686-pc-linux-gnu/libstdc++-v3/include/bits/ios_base.h:111:0: note: a type with different memory representation is defined in another translation unit ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:56:0: warning: type of 'buf_wcerr' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:56:0: warning: type of 'buf_wcin' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:56:0: warning: type of 'buf_wcout' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:56:0: warning: type of 'buf_cerr' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:56:0: warning: type of 'buf_cin' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:56:0: warning: type of 'buf_cout' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'wclog' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:64:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'wcerr' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:64:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'wcin' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:64:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'wcout' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:64:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'buf_wcerr_sync' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'buf_wcin_sync' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'buf_wcout_sync' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'clog' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:64:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'cerr' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:64:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'cin' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:64:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'cout' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:64:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'buf_cerr_sync' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'buf_cin_sync' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here ../../../../../gcc-5/libstdc++-v3/src/c++98/ios_init.cc:37:0: warning: type of 'buf_cout_sync' does not match original declaration ../../../../../gcc-5/libstdc++-v3/src/c++98/globals_io.cc:76:0: note: previously declared here /tmp/build/prev-i686-pc-linux-gnu/libstdc++-v3/include/bits/basic_ios.h:67:11: warning: virtual table of type 'struct basic_ios' violates one definition rule class basic_ios : public ios_base ^ /tmp/build/i686-pc-linux-gnu/libstdc++-v3/include/bits/basic_ios.h:91:0: note: the conflicting type defined in another translation unit /tmp/build/i686-pc-linux-gnu/libstdc++-v3/include/bits/basic_ios.h:67:0: note: virtual method '_ZTISt9basic_iosIcSt11char_traitsIcEE' /tmp/build/i686-pc-linux-gnu/libstdc++-v3/include/bits/basic_ios.h:67:0: note: ought to match virtual method '__comp_dtor ' but does not /tmp/build/prev-i686-pc-linux-gnu/libstdc++-v3/include/fstream:656:11: warning: virtual table of type 'struct basic_ofstream' violates one definition rule class basic_ofstream : public basic_ostream<_CharT,_Traits> ^ /tmp/build/i686-pc-linux-gnu/libstdc++-v3/include/fstream:467:0: note: the conflicting type defined in another translation unit /tmp/build/i686-pc-linux-gnu/libstdc++-v3/include/fstream:467:0: note: contains additional virtual method '_ZTISo' /tmp/build/prev-i686-pc-linux-gnu/libstdc++-v3/include/fstream:656:11: warning: virtual table of type 'struct basic_ofstream' violates one definition rule class basic_ofstream : public basic_ostream<_CharT,_Traits> ^ /tmp/build/i686-pc-linux-gnu/libstdc++-v3/include/fstream:467:0: note: the conflicting type defined in another translation unit /tmp/build/i686-pc-linux-gnu/libstdc++-v3/include/fstream:238:0: note: virtual method '__deleting_dtor ' /tmp/build/i686-pc-linux-gnu/libstdc++-v3/include/fstream:238:0: note: ought to match virtual method '__comp_dtor ' but does not ../../gcc-5/gcc/dwarf2out.c: In function 'add_addr_table_entry': ../../gcc-5/gcc/dwarf2out.c:4253:41: warning: 'finder.addr.label' may be used uninitialized in this function [-Wmaybe-uninitialized] inchash::add_rtx (a->addr.rtl, hstate); ^ ../../gcc-5/gcc/dwarf2out.c:4303:20: note: 'finder.addr.label' was declared here addr_table_entry finder; ^ ../../gcc-5/gcc/auto-profile.c: In member function 'execute': /tmp/build/prev-i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_tree.h:1523:2: warning: 'only_one' may be used uninitialized in this function [-Wmaybe-uninitialized] if (!_M_impl._M_key_compare(_S_key(__x), __k)) ^ ../../gcc-5/gcc/auto-profile.c:1282:12: note: 'only_one' was declared here edge only_one; ^ ../../gcc-5/libbacktrace/elf.c: In function 'elf_add': ../../gcc-5/libbacktrace/mmapio.c:98:7: warning: 'ehdr_view.len' may be used uninitialized in this function [-Wmaybe-uninitialized] if (munmap (const_cast.v, view->len) < 0) ^ ../../gcc-5/libbacktrace/elf.c:524:25: note: 'ehdr_view.len' was declared here struct backtrace_view ehdr_view; ^ ../../gcc-5/libbacktrace/mmapio.c:98:7: warning: 'ehdr_view.base' may be used uninitialized in this function [-Wmaybe-uninitialized] if (munmap (const_cast.v, view->len) < 0) ^ ../../gcc-5/libbacktrace/elf.c:524:25: note: 'ehdr_view.base' was declared here struct backtrace_view ehdr_view; ^ ../../gcc-5/libbacktrace/elf.c:564:3: warning: 'ehdr_view.data' may be used uninitialized in this function [-Wmaybe-uninitialized] memcpy (&ehdr, ehdr_view.data, sizeof ehdr); ^ ../../gcc-5/libbacktrace/elf.c:524:25: note: 'ehdr_view.data' was declared here struct backtrace_view ehdr_view; ^ ../../gcc-5/gcc/calls.c: In function 'expand_call': ../../gcc-5/gcc/dojump.c:127:56: warning: 'save.x_stack_pointer_delta' may be used uninitialized in this function [-Wmaybe-uninitialized] stack_pointer_delta = save->x_stack_pointer_delta; ^ ../../gcc-5/gcc/calls.c:2799:34: note: 'save.x_stack_pointer_delta' was declared here saved_pending_stack_adjust save; ^ ../../gcc-5/gcc/dojump.c:126:58: warning: 'save.x_pending_stack_adjust' may be used uninitialized in this function [-Wmaybe-uninitialized] pending_stack_adjust = save->x_pending_stack_adjust; ^ ../../gcc-5/gcc/calls.c:2799:34: note: 'save.x_pending_stack_adjust' was declared here saved_pending_stack_adjust save; ^ ../../gcc-5/gcc/builtins.c: In function 'c_readstr': ../../gcc-5/gcc/builtins.c:663:17: warning: 'tmp[0]' may be used uninitialized in this function [-Wmaybe-uninitialized] HOST_WIDE_INT tmp[MAX_BITSIZE_MODE_ANY_INT / HOST_BITS_PER_WIDE_INT]; ^