lkml.org 
[lkml]   [2000]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Patch to remove undefined C code
From
Date
Matti Aarnio <matti.aarnio@zmailer.org> writes:

> On Mon, Oct 16, 2000 at 04:55:08PM -0400, Ben Pfaff wrote:
> > Yes. In practice the usual question is whether the compiler will
> > evaluate the operands from left to right or from right to left,
> > but the compiler is within its rights to evaluate the operands in
> > any order it wants.
>
> That depends mainly on question: Does your stack grow up or down ?

No it doesn't. It depends mainly on whether the ABI for the
machine says that arguments are pushed onto the stack in
left-to-right or right-to-left order. You could do either on
x86, for instance, and it has nothing to do with whether the x86
stack grows up or down.

> > > Does this imply that even the evaluation of a function pointer
> > > is itself undefined in terms of ordering?
> >
> > Yes.
>
> For things like lone pointer referral with pre/post inc/dec:
> *p++
> it is well defined, but for things like:
> *p++ + *p
> it is not. (Will the second *p be evaluated before or after *p++
> post-increment ?)

Non sequitur: I see no function pointers being evaluated here.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.087 / U:9.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site