Re: [PATCH] C undefined behavior fix

From: Paul Mackerras (paulus@samba.org)
Date: Fri Jan 04 2002 - 17:14:38 EST


Florian Weimer writes:

> Paul Mackerras <paulus@samba.org> writes:
>
> > One of the reasons why C is a good language for the kernel is that its
> > memory model is a good match to the memory organization used by the
> > processors that linux runs on. Thus, for these processors, adding an
> > offset to a pointer is in fact simply an arithmetic addition.
>
> But this is not the memory model of C! Adding an offset to a pointer
> is an operation involving objects defined by the C language, and not
> machine registers. Sometimes, this makes a noticeable difference.

Sorry, you are correct. I should have written "One of the reasons why
C used to be a good language for writing operating system kernels ..."

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/



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