[lkml]   [2000]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: Patch to remove undefined C code
-----Original Message-----
From: Ben Pfaff []
>Jonathan George <> writes:
>> This patch has many bogus corrections where new variables were created,
>> the order of evaluation is already unambiguous.
>> For example each comma separated clause in an expression is guaranteed to
>> completely evaluated before the next comma separated clause Including
>> Assignments.
>No, that is not true in general. When the comma in question is
>the comma operator, it is true. But when the comma separates
>arguments to a function, it is not: the order of evaluation of
>function arguments is implementation dependent. See C89 section
> "Function calls":
> $ 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. Does this imply that even
the evaluation of a function pointer is itself undefined in terms of

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

Absolutely true.

However, optimization of well tested, and algorithmically validated kernel
code in a time critical section does not constitute premature optimization
as I'm sure Donald would agree.

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.

That is my only real concern (other than all of that syntactically ambiguous
code I have written over the last 15 years ;-) is that critical performance
not be compromised in the kernel.

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.115 / U:1.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site