From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH 0/2] Fix invalid left shift of negative value.
Date: Tue, 10 Nov 2015 22:42:00 -0000 [thread overview]
Message-ID: <20151110154243.43d38f49@pinnacle.lan> (raw)
In-Reply-To: <20151110111638.GD17214@linux.vnet.ibm.com>
On Tue, 10 Nov 2015 12:16:38 +0100
Dominik Vogt <vogt@linux.vnet.ibm.com> wrote:
> The following series of patches fixes all occurences of
> left-shifting negative constants in C code which is undefined by
> the C standard. The patches have been tested on s390x, covering
> only a small subset of the changes.
Looking at one of your changes from part 1/2...
- (LONGEST) -1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1);
+ -((LONGEST) 1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1));
What aspect of the original expression is not defined by the C standard?
(I'm looking at an old copy of Harbison & Steel; the original expression
looks okay to me, but perhaps I'm missing something...)
FWIW, I have an easier time understanding the intent of the first/original
expression than your proposed replacement.
Kevin
next prev parent reply other threads:[~2015-11-10 22:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 11:16 Dominik Vogt
2015-11-10 11:17 ` [PATCH 1/2] " Dominik Vogt
2015-11-10 11:18 ` [PATCH 2/2] " Dominik Vogt
2015-11-10 22:42 ` Kevin Buettner [this message]
2015-11-11 17:23 ` [PATCH 0/2] " Ulrich Weigand
2015-11-11 19:27 ` Kevin Buettner
2015-11-17 5:09 ` Kevin Buettner
2015-11-17 14:13 ` Pedro Alves
2015-11-17 17:33 ` Paul_Koning
2015-11-17 15:10 ` [PATCH 3/2] " Dominik Vogt
2015-11-17 17:49 ` Kevin Buettner
2015-11-30 8:54 ` Dominik Vogt
2015-12-06 14:17 ` [SIM patch] " Joel Brobecker
2015-12-15 13:15 ` Andreas Arnez
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=20151110154243.43d38f49@pinnacle.lan \
--to=kevinb@redhat.com \
--cc=gdb-patches@sourceware.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