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++/59472] Many warnings "type of 'X' does not match original declaration" when linking with libstdc++ static library compiled with -flto


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59472

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #1)
> Reassigning to libstdc++ because the warnings seem to say the truth.

They do tell the truth.

We use char arrays for good reason (see the comment in src/c++98/globals_io.cc)
but I'm not sure why we have to lie about the types in src/c++98/ios_init.cc, I
think it's only so we can call the destructors in ios::sync_with_stdio:

    // Explicitly call dtors to free any memory that is
    // dynamically allocated by filebuf ctor or member functions,
    // but don't deallocate all memory by calling operator delete.
    buf_cout_sync.~stdio_sync_filebuf<char>();
    buf_cin_sync.~stdio_sync_filebuf<char>();
    buf_cerr_sync.~stdio_sync_filebuf<char>();

But I think that could be done by casting the char array to stdio_sync_filebuf*
instead.


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