public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "de34 at live dot cn" <gcc-bugzilla@gcc.gnu.org>
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 12:23:24 +0000	[thread overview]
Message-ID: <bug-70476-4-4xD10WxdI9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-70476-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70476

--- Comment #15 from Jiang An <de34 at live dot cn> ---
(In reply to Maciej S. Szmigiero from comment #14)
> > 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.).
> 
> The standard allows different calling conventions for "C" and "C++" language
> linkage and that's what matters when writing standard-compliant code - one
> shouldn't write to a particular implementation (or implementations).
> 

The problem in pratice is that most implementations are not standard-compliant
here. If you rely on the standard guarantee that extern "C" and extern "C++"
make function types different, you probably get compilation errors.

> > > All functions and variables whose names have external linkage and all
> > > function types have a language linkage.
> > 
> > which implies that a function with internal linkage doesn't have a language > linkage, and thus [dcl.link]/7 doesn't apply to it.
> 
> Nothing in the above quote says that *only* these specified have a language
> linkage, just that these explicitly enumerated sure do.


I think the italic style is "the thing", which should mean that the term
"language linkage" is introduced and restricted here.

  parent reply	other threads:[~2023-03-13 12:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-70476-4@http.gcc.gnu.org/bugzilla/>
2021-08-27  0:05 ` pinskia at gcc dot gnu.org
2021-08-27  9:17 ` redi at gcc dot gnu.org
2021-08-27  9:18 ` redi at gcc dot gnu.org
2021-08-27  9:27 ` redi at gcc dot gnu.org
2021-08-27  9:34 ` redi at gcc dot gnu.org
2023-03-11 23:32 ` mail at maciej dot szmigiero.name
2023-03-11 23:43 ` pinskia at gcc dot gnu.org
2023-03-11 23:53 ` pinskia at gcc dot gnu.org
2023-03-12  0:48 ` mail at maciej dot szmigiero.name
2023-03-13  4:58 ` de34 at live dot cn
2023-03-13  5:03 ` de34 at live dot cn
2023-03-13 11:23 ` mail at maciej dot szmigiero.name
2023-03-13 12:23 ` de34 at live dot cn [this message]
2023-03-16 16:48 ` mail at maciej dot szmigiero.name

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-70476-4-4xD10WxdI9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).