From: Segher Boessenkool <segher@kernel.crashing.org>
To: vogt@linux.vnet.ibm.com, gcc-patches@gcc.gnu.org,
Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Subject: Re: [PATCH 1/2] PR77822
Date: Fri, 18 Nov 2016 09:31:00 -0000 [thread overview]
Message-ID: <20161118093139.GH3732@gate.crashing.org> (raw)
In-Reply-To: <20161117155347.GB21578@linux.vnet.ibm.com>
Hi Dominik,
On Thu, Nov 17, 2016 at 04:53:47PM +0100, Dominik Vogt wrote:
> +/* A convenience macro to determine whether a SIZE lies inclusively
> + within [1, RANGE], POS lies inclusively within between
> + [0, RANGE - 1] and the sum lies inclusively within [1, RANGE]. */
> +#define SIZE_POS_IN_RANGE(SIZE, POS, RANGE) \
> + (IN_RANGE (POS, 0, (RANGE) - 1) \
> + && IN_RANGE (SIZE, 1, RANGE) \
> + && IN_RANGE ((SIZE) + (POS), 1, RANGE))
You should put parens around every use of SIZE, POS, RANGE -- there could
be a comma operator in the macro argument.
You don't check if SIZE+POS overflows / wraps around. If you really don't
care about that, you can lose the
> + && IN_RANGE (SIZE, 1, RANGE) \
part as well?
Segher
next prev parent reply other threads:[~2016-11-18 9:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 15:53 [PATCH 0/2] PR77822 Dominik Vogt
2016-11-17 15:54 ` [PATCH 2/2] PR77822 Dominik Vogt
2016-11-21 11:05 ` [PATCH 2/2 v3] PR77822 Dominik Vogt
2016-11-25 8:26 ` Dominik Vogt
2016-12-02 8:38 ` Andreas Krebbel
2016-11-17 15:54 ` [PATCH 1/2] PR77822 Dominik Vogt
2016-11-18 9:31 ` Segher Boessenkool [this message]
2016-11-18 12:09 ` Dominik Vogt
2016-11-18 14:02 ` Segher Boessenkool
2016-11-18 15:29 ` Dominik Vogt
2016-11-21 11:04 ` [PATCH 1/2 v3] PR77822 Dominik Vogt
2016-11-23 20:22 ` Jeff Law
2016-11-24 9:59 ` Dominik Vogt
2016-11-24 15:33 ` Jeff Law
2016-11-25 8:30 ` Dominik Vogt
2016-11-28 22:29 ` Jeff Law
2016-12-02 8:39 ` Andreas Krebbel
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=20161118093139.GH3732@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=krebbel@linux.vnet.ibm.com \
--cc=vogt@linux.vnet.ibm.com \
/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).