This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/64275] Warnings when linking GCC go1: "(virtual table of) type 'struct X' violates one definition rule"


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64275

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The simplest way to solve this might be to replace the extern declarations in
ios_init.cc such as:

  extern stdio_sync_filebuf<char> buf_cout_sync;

with a pointer:

  extern stdio_sync_filebuf<char>* buf_cout_sync_p;

then in globals_io.cc do:

  stdio_sync_filebuf<char>* buf_cout_sync_p =
    reintepret_cast<stdio_sync_filebuf<char>*>(buf_cout_sync);

That way we have an explicit cast rather than just relying on the linker
finding the symbol.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]