Re: MSEC_TO_JIFFIES is messed up...
From: Paul Wagland (paul_at_wagland.net)
Date: Sun, 16 May 2004 14:10:06 +0200 To: Chris Wedgwood <firstname.lastname@example.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.
> 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.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
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