From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9121 invoked by alias); 4 Jan 2012 13:06:31 -0000 Received: (qmail 9107 invoked by uid 22791); 4 Jan 2012 13:06:30 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Wed, 04 Jan 2012 13:06:15 +0000 From: "marc.glisse at normalesup dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/2316] g++ fails to overload on language linkage Date: Wed, 04 Jan 2012 13:06: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: ABI, accepts-invalid, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: marc.glisse at normalesup dot 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-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-01/txt/msg00377.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #45 from Marc Glisse 2012-01-04 13:06:10 UTC --- (In reply to comment #42) > Well, perhaps something like: > #ifdef __cplusplus > extern "C++" int __REDIRECT_NTH (pthread_create, (pthread_t *__restrict > __newthread, const pthread_attr_t *__restrict __attr, > void *(*__start_routine) (void *), > void *__restrict __arg) __nonnull ((1, 3)), pthread_create); > #endif > (for glibc) could do the trick (and similarly for qsort and other C functions > that take callbacks?) For bsearch and qsort, the standard actually requires those (and solaris has them, although we fixinclude them out currently). For posix functions, well, the posix-c++-wg mailing-list hasn't seen a single email since March 2010... > still I agree this would be terribly annoying for everybody. Yes. > At least this shouldn't be considered for GCC 4.7 at this point. Oh, of course. Maybe not even 4.8. In the patch, I (partially) enabled alias templates in system headers because there are some things in libstdc++ that may not be possible to do without those, so it may be better to wait until -std=c++11 becomes the default if we want to do that. Plus, that completely breaks the ABI, so it should be synchronized with other ABI-breaking changes. And we may even decide on an official WONTFIX.