From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AC41C3858D35; Thu, 16 Mar 2023 16:48:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC41C3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678985329; bh=XXHRiuLAsJWqYDzbqsJ5e3UWSF4Nxg+iwkG+8CyUxuw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GHpCq3N4qdazFDIRUhRdQYXSuSJRXsaGMe52lCbIrbizGpX1q8HKS6vBswIIuFwGi FkaIuvXTD3mSMYjbaBxkOyTcWVbt1qHGoFXLFYMIHAdelSne3p91XQsiG7cQFlGhl7 259wQJ055Crr1LzXzq4NBk2sTEkywKUJSVDucoJA= From: "mail at maciej dot szmigiero.name" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/70476] C++11: Function name declared in unnamed namespace extern "C" gets exernal linkage Date: Thu, 16 Mar 2023 16:48:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: assemble-failure, link-failure, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mail at maciej dot szmigiero.name X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D70476 --- Comment #16 from Maciej S. Szmigiero --- > If you rely on the standard guarantee that extern "C" and extern "C++" ma= ke function types different, you probably get compilation errors. It's the other way around - functions in standard-compliant code should have proper language linkage markings (including implicit markings). They are needed in case some compiler or platform decides that, for example, "C" and "C++" language linkages need to have different calling conventions. Which is something that the standard allows. However, this bug is about having internal linkage for all anonymous namesp= ace functions (including the ones declared with "C" language linkage) - whether= "C" and "C++" language linkages should be allowed to have different calling conventions is a different matter.=