public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "d.g.gorbachev at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-64275-4@http.gcc.gnu.org/bugzilla/> (raw)

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];
                 ^


             reply	other threads:[~2014-12-11 19:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 19:09 d.g.gorbachev at gmail dot com [this message]
2014-12-11 19:10 ` [Bug libstdc++/64275] " d.g.gorbachev at gmail dot com
2015-01-30 11:24 ` redi at gcc dot gnu.org
2015-02-12 14:54 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-64275-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).