Re: MSEC_TO_JIFFIES is messed up...
From: Paul Wagland (paul_at_wagland.net)
Date: 05/16/04
- Previous message: tmp: "Kernel OOPS"
- In reply to: Chris Wedgwood: "Re: MSEC_TO_JIFFIES is messed up..."
- Next in thread: Valdis.Kletnieks_at_vt.edu: "Re: MSEC_TO_JIFFIES is messed up..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 16 May 2004 14:10:06 +0200 To: Chris Wedgwood <cw@f00f.org>
On May 16, 2004, at 5:48, Chris Wedgwood wrote:
> On Wed, May 12, 2004 at 11:55:18PM +0200, Andreas Schwab wrote:
>
>> Signed integer overflow is undefined in C, so the compiler is
>> allowed to assume it does not happen.
>
> Really?
>
> Just because something is undefined assuming it never happens is a bit
> of a leap of faith IMO.
More precisely, if something has undefined semantics then the compiler
is allowed to do whatever it likes. Normally the compiler will try to
do "what's right", but if they have an optimisation opportunity then
they will normally take it.
In other words by assuming it "doesn't happen" they get to perform an
optimisation that they could not do otherwise, and they get to perform
"correctly" in an undefined way when the overflow would happen.
Cheers,
Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- application/pgp-signature attachment: This is a digitally signed message part
- Previous message: tmp: "Kernel OOPS"
- In reply to: Chris Wedgwood: "Re: MSEC_TO_JIFFIES is messed up..."
- Next in thread: Valdis.Kletnieks_at_vt.edu: "Re: MSEC_TO_JIFFIES is messed up..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|