From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0FD353858D32; Mon, 13 Mar 2023 04:58:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FD353858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678683503; bh=LAbvpCjjEPZ+nqTN58O7McQ22ReBbgtMsearTlAKlwA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=anfP/vM6pCp7JSQ1E93IKYJmhZRis+oDH+IoAYEPdh4qL8H8DkFHAGnB+CKXLrTgU +xybPsYGi2SzEYsb6vYkq4x+zE5V0JnWFxoexTMeQ0DhDenSS8gP7gIDJXciy94UKH 80CFWZTwdBBr7Dz/OkEd8wiDRA5Y9bVVA9nm3AbE= From: "de34 at live dot cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/70476] C++11: Function name declared in unnamed namespace extern "C" gets exernal linkage Date: Mon, 13 Mar 2023 04:58:22 +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: de34 at live dot cn 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: cc 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 Jiang An changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |de34 at live dot cn --- Comment #12 from Jiang An --- It seems that the current specification is still broken for extern "C" functions with internal linkage.(In reply to Maciej S. Szmigiero from comme= nt #8) > Having functions with "C" language linkage (calling convention, etc) but > internal linkage is useful for writing callbacks provided to C functions. >=20 > It's not an significant issue, however, as one can get the same effect by > declaring the callback function "static" inside an "extern C" block. This is not so useful in practice because most compilers don't make extern = "C" and extern "C++" differentiate function types (implying calling conventions etc.). There's a long battle story, and the divergence between the standard and implementations is not resolved yet. See https://cplusplus.github.io/CWG/issues/1555.html https://lists.isocpp.org/sg12/2020/04/0900.php=