piclist 2008\07\28\101157a >
Thread: Starting with C
www.piclist.com/techref/microchip/languages.htm?key=c
flavicon
face BY : sergio masci email (remove spam text)





On Mon, 28 Jul 2008, Gerhard Fiedler wrote:

{Quote hidden}

Where do I want to go with this?

What I really want to do is get across to the average C user that although
"arr" may seem to be a constant it is actually (usually) a runtime
variable and has overheads associated with its use.

Comments about how easily access to an indexed array element can be
optimised to a direct access with (implied) no runtime overhead are very
misleading (I'm not pointing at anyone in particular here).

> > Come on you can't base a function optimisation argument on what happens
> > in "main"
>
> FWIW, my preceding comment is valid for any function like the above
> (whether main() or further down in the call tree), with a local variable
> that is only set, never read and isn't declared volatile.

Yes but it is VERY easy to optimise some things in "main" because it is
known to be the first function called at runtime. Trying to do similar
optimisations for other functions requires a lot of work on the part of
the compiler.


Regards
Sergio
<Pine.LNX.4.61.0807281619270.20852@yoda.srts.co.uk> 7bit

In reply to: <1wjr6pxf9xoev$.dlg@connectionbrazil.com>
See also: www.piclist.com/techref/microchip/languages.htm?key=c
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Starting with C

month overview.

new search...