Re: [PATCH] C undefined behavior fix

From: Paul Mackerras (
Date: Fri Jan 04 2002 - 04:29:19 EST

Pavel Machek writes:

> gcc is allowed not to pass it anywhere. You may not second guess
> optimizer. If it is not defined, it is not defined.
> Imagine
> strcpy(a, "xyzzy"+b);
> if (b>16)
> printf("foo");
> . gcc is permitted to kill printf(), because if b<0 or b>16 behaviour is
> undefined. So gcc may assume b<=16.

So... I'm curious. How is the result of virt_to_phys ever anything
other than undefined?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:24 EST