On 06/01/12 1:11 PM, Fred Cisin wrote:
On Fri, 6 Jan 2012, Ian King wrote:
On 1/5/12 8:43 PM, "Fred
Cisin"<cisin at xenosoft.com> wrote:
[snip]
BUT, even in this example, unless the compiler
does "optimization" to
compile something other than what you asked for (DWIM!) and removes the
temporary variable,
The only time modern compilers don't do optimization is when you tell them
not to, usually so you can step through the code in a debugger. One of
I will concede that "modern" compilers DEFAULT to optimization on.
(I'm not modern)
gcc doesn't, although the level expected "for free" has probably changed
in 35 years. lcc does not have an "optimiser" yet can produce very good
code with good machine descriptions.
Yeah, having debugged code that tried to be
'clever' and could have been
written clearly instead, Holub and I would be on opposite sides of that
argument. It was true thirty years ago that 'cleverly' written C could be
faster (and there were tests to prove it), but there's little
justification for that position today.
That's my point.
+1.
--Toby
To be fair, my chats with Holub WERE 25 - 30 years ago. So, the
environment is now different.