Re: A note on personal corruption as a result of using C
- From: "Clive D. W. Feather" <clive@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 22 Feb 2008 10:10:34 +0000
In article <a300aa54-a28b-4828-9290-21e98a8b4c9c@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, spinoza1111 <spinoza1111@xxxxxxxxx> writes
(Sigh). The PROBLEM was that you used an invariant and you counted on
the compiler to optimize.
Why is that a problem? That is precisely what compilers are supposed to do.
It has been the practice in the past to
assault posters for this practice here
I see no evidence of this whatsoever. Please post a pointer to an article where somebody was "assaulted" for using an optimisable invariant in a for loop. Note that strlen() is not an optimisable invariant.
Incidentally, all I've seen in your case is Richard pointing out that it would be more efficient to store the length in a variable. Not just because of the loop, but for a couple of other uses of it in the same function. Hardly "assault". Certainly not comparable with your ranting because I pointed out a minor bug in your stack machine code.
but you were not assaulted
because you're a one of the thugs. You want a free pass
Usual Nilges rant.
for plus one
which is in some situations optimized by the compiler and in other
situations not:
I would expect it to be optimised any time I select optimisation by the compiler and it's optimisable.
but strlen can also be a constant expression
[Nitpick: "constant expression" is a technical term which this isn't an instance of. But ignoring that ...]
Yes, it can. However, the compiler can not - absent unusual circumstances which I don't think applied to your code - it can't be detected as such by the compiler. Therefore it would be unusual for it to even attempt to do so.
whereas
in OTHER situations plus one may not be.
Example? Where the loop condition is an invariant, I mean. Obviously if it's altered within the loop, the plus one probably can't be optimised away.
You combine only a superficial, nonpractitioner's knowledge with the
willingness to create confusion because (as we know) you're a
politician who has long replaced competence with the willingness to
transform technical issues to personal vendettas.
"We" don't know anything of the sort. And this isn't a "vendetta" - stop posting lies and libel about me, and I'll stop pointing out to the world where you're doing so.
--
Clive D.W. Feather | Home: <clive@xxxxxxxxxx>
Tel: +44 20 8495 6138 (work) | Web: <http://www.davros.org>
Fax: +44 870 051 9937 | Work: <clive@xxxxxxxxx>
Please reply to the Reply-To address, which is: <clive@xxxxxxxxxx>
.
- Follow-Ups:
- Re: A note on personal corruption as a result of using C
- From: santosh
- Re: A note on personal corruption as a result of using C
- References:
- A note on personal corruption as a result of using C
- From: spinoza1111
- Re: A note on personal corruption as a result of using C
- From: Keith Thompson
- Re: A note on personal corruption as a result of using C
- From: Clive D. W. Feather
- Re: A note on personal corruption as a result of using C
- From: spinoza1111
- Re: A note on personal corruption as a result of using C
- From: Ben Bacarisse
- Re: A note on personal corruption as a result of using C
- From: spinoza1111
- Re: A note on personal corruption as a result of using C
- From: Ben Bacarisse
- Re: A note on personal corruption as a result of using C
- From: spinoza1111
- Re: A note on personal corruption as a result of using C
- From: Ben Bacarisse
- Re: A note on personal corruption as a result of using C
- From: spinoza1111
- Re: A note on personal corruption as a result of using C
- From: Clive D. W. Feather
- Re: A note on personal corruption as a result of using C
- From: spinoza1111
- A note on personal corruption as a result of using C
- Prev by Date: Re: A note on personal corruption as a result of using C
- Next by Date: Re: strlen(), K+1: clarification
- Previous by thread: Re: A note on personal corruption as a result of using C
- Next by thread: Re: A note on personal corruption as a result of using C
- Index(es):
Relevant Pages
|