From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15115 invoked by alias); 21 May 2012 10:21:30 -0000 Received: (qmail 15100 invoked by uid 22791); 21 May 2012 10:21:29 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 May 2012 10:21:16 +0000 From: "sweetrommie at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53398] feature request: option for overloaded methods order in vtable compatibility with msc Date: Mon, 21 May 2012 10:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: sweetrommie 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-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-05/txt/msg01995.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53398 --- Comment #2 from Roman Wieczorek 2012-05-21 10:18:35 UTC --- (In reply to comment #1) > I think if we provide an option for this, we are > going to have people abuse this. The risk i see here is about compatibility of gcc compiled libraries with other object files. That's why i suggest changing vtable order only for a block of code, or for single class, like "__attribute__ ((__packed__)))" does. > Also I think the C++ ABIs between MS and GCC not compatible at all since they > use different mangling. Dynamic libraries (for windows) which follow COM spec, uses only pure virtual class. They do not export class them in the dll, but provides an ansi C function for creating an object. In such cases the only exported objects are C functions. It also avoids C++ name mangling problems. As it goes for dll i met, it works. Probably because COM was well documented. The only problem I found, is the order of overloaded functions. COM does not allow overloading. Here the method i showed helps and library becomes compatible. > MS does not follow the cross target/compiler ABI (IA64 > C++ ABI). The docs shows it is in section 2.5.3.1 http://sourcery.mentor.com/public/cxx-abi/abi.html#vtable It is similar in COM spec (chapter 3) http://www.daimi.au.dk/~datpete/COT/COM_SPEC/pdf/com_spec.pdf No idea why msc behaves overloaded functions different.