[lkml]   [2000]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Patch to remove undefined C code
Jonathan George <> writes:

> > $ The order of evaluation of the function designator, the
> > $ arguments, and subexpressions within the arguments is
> > $ unspecified, ...
> >--
> I sit surprised and corrected. With every version of every C compiler on
> every OS I have ever used (over 100 combinations from AmigaDOS 1.1 using
> Manx C to E10000 using Kai C++) the behavior has been the same for parameter
> lists as for the comma operator in this respect.

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.

> Does this imply that even the evaluation of a function pointer
> is itself undefined in terms of ordering?


> >"Premature optimization is the root of all evil."
> >--D. E. Knuth, "Structured Programming with go to Statements"
> Absolutely true.

Good sigmonster, have $TREAT.

> I would be really interested to see how well the kernel compiler does at
> optimizing out all of these new tmp variables in terms of the resulting
> register utilization and performance. At least an assembler code size
> comparison is in order for each of these individual cases.

I agree with you and Al Viro that the proposed fixes were less
than desirable.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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