This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] C undefined behavior fix


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]