From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17358 invoked by alias); 8 May 2014 13:24:46 -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 17325 invoked by uid 48); 8 May 2014 13:24:43 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/59472] Many warnings "type of 'X' does not match original declaration" when linking with libstdc++ static library compiled with -flto Date: Thu, 08 May 2014 13:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: diagnostic, lto X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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-05/txt/msg00675.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59472 --- Comment #3 from Jonathan Wakely --- (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(); buf_cin_sync.~stdio_sync_filebuf(); buf_cerr_sync.~stdio_sync_filebuf(); But I think that could be done by casting the char array to stdio_sync_filebuf* instead.