From: Joseph Myers <joseph@codesourcery.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] sim: warnings: disable -Wshift-negative-value
Date: Fri, 29 Dec 2023 00:52:58 +0000 [thread overview]
Message-ID: <9b592c16-dc57-1bb7-5438-26c794d61d1c@codesourcery.com> (raw)
In-Reply-To: <20231224082639.18038-1-vapier@gentoo.org>
On Sun, 24 Dec 2023, Mike Frysinger wrote:
> The sim expects left shift operations on negative values to have two's
> compliment behavior, and right shift operations to sign extend. In C89,
> this was not explicitly mentioned. In C90, this was changed to undefined
> behavior. In C23, this was settled as the behavior we want in N2412 [1].
No, there has been no change in C23 to the rules for which shifts are
undefined. The change made was to make *representations* of integer types
defined as two's complement; there were no changes to semantics of
*operations* on such types.
--
Joseph S. Myers
joseph@codesourcery.com
next prev parent reply other threads:[~2023-12-29 0:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-24 8:26 Mike Frysinger
2023-12-29 0:52 ` Joseph Myers [this message]
2024-01-05 7:40 ` Mike Frysinger
2024-01-07 4:45 ` [PATCH] sim: cgen: rework DI macros to avoid signed left shifts Mike Frysinger
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=9b592c16-dc57-1bb7-5438-26c794d61d1c@codesourcery.com \
--to=joseph@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=vapier@gentoo.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).