public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "xry111 at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/112826] gcc rejects the valid code and reports undefined reference
Date: Sat, 02 Dec 2023 16:31:10 +0000	[thread overview]
Message-ID: <bug-112826-4-xQSl3U9rWt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112826-4@http.gcc.gnu.org/bugzilla/>

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |xry111 at gcc dot gnu.org

--- Comment #2 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
N1570 6.9 p2:

"If an identifier declared with external linkage is used in an expression
(other than as part of the operand of a sizeof or _Alignof operator whose
result is an integer constant), somewhere in the entire program there shall be
exactly one external definition for the identifier"

and annex J.2 explicitly lists "An identifier with external linkage is used,
but in the program there does not exist exactly one external definition for the
identifier" as undefined behavior.

Note that you cannot interpret "used" as "really executed at runtime" because
it's impossible to solve halting problem, so such an "interpretation" will
render the entire standard nonsense.

  parent reply	other threads:[~2023-12-02 16:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-02 15:32 [Bug c/112826] New: " jwzeng at nuaa dot edu.cn
2023-12-02 15:43 ` [Bug c/112826] " arsen at gcc dot gnu.org
2023-12-02 16:31 ` xry111 at gcc dot gnu.org [this message]
2023-12-02 22:43 ` pinskia at gcc dot gnu.org
2023-12-03  8:01 ` jwzeng at nuaa dot edu.cn

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-112826-4-xQSl3U9rWt@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).