Re: [PATCH] C undefined behavior fix

From: Tim Hollebeek (tim@hollebeek.com)
Date: Mon Jan 07 2002 - 17:28:32 EST


> Nothing's taking the pointer's address, so the compiler _will_ be able
> to prove that (in a sensible universe) no other thread, interrupt,
> kernel code or Angered Rain God will be able to find our pointer--much
> less change it.

You're not allowed to be that smart wrt volatile. If the programmer
says the value might change unpredictably and should not be optimized,
then It Is So and the compiler must respect that even if it determines
It Cannot Possibly Happen.

-Tim
-
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/



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