public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Kevin Easton <kevin@guarana.org>
Cc: linux-kernel@vger.kernel.org, john.stultz@linaro.org,
	davem@davemloft.net, arnd@arndb.de, mingo@kernel.org,
	torvalds@linux-foundation.org
Subject: Re: [PATCH jiffies] Avoid undefined behavior from signed overflow
Date: Mon, 29 Jul 2013 07:28:12 -0700	[thread overview]
Message-ID: <20130729142812.GN26694@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130730000103.35524r83mpydvs7z@chicago.guarana.org>

On Tue, Jul 30, 2013 at 12:01:03AM +1000, Kevin Easton wrote:
> Quoting "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>:
> 
> >On Mon, Jul 29, 2013 at 03:30:35PM +1000, caf@guarana.org wrote:
> >>Quoting "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>:
> >>
> ...
> >>>
> >>>Note that the C standard considers the cast from signed to
> >>>unsigned to be implementation-defined, see 6.3.1.3p3.
> ...
> >>
> >>Don't worry, the case from signed to unsigned is actually well-defined -
> >>the relevant part is 6.3.1.3p2 (in C99):
> >>
> >>>Otherwise, if the new type is unsigned, the value is converted by
> >>>repeatedly adding or subtracting one more than the maximum value that
> >>>can be represented in the new type until the value is in the range of
> >>>the new type.
> >
> >Yep, but we are going in the other direction, from unsigned to signed.
> 
> Ahh, there's an error in the commit message (it says signed to unsigned).

Good catch, fixed!

							Thanx, Paul


  reply	other threads:[~2013-07-29 14:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27 22:58 [PATCH jiffies] Avoid undefined behavior from signed overflow Paul E. McKenney
2013-07-28 18:46 ` Eric Dumazet
2013-07-29  2:55   ` Paul E. McKenney
2013-07-29  5:30 ` caf
2013-07-29 13:54   ` Paul E. McKenney
2013-07-29 14:01     ` Kevin Easton
2013-07-29 14:28       ` Paul E. McKenney [this message]
2013-08-04 19:16         ` Linus Torvalds
2013-08-04 20:20           ` Paul E. McKenney
2013-08-04 20:23             ` Linus Torvalds
2013-08-04 20:34               ` Paul E. McKenney

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=20130729142812.GN26694@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=john.stultz@linaro.org \
    --cc=kevin@guarana.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=torvalds@linux-foundation.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