Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Finally, really, actually, starting off with C

2009-01-07 by David VanHorn

Yes.. The world probably will end in 2012, brought about in no small
part by my conversion to C.

I bought an AVR-LIP kit from Deccan, and am using WINAVR to get going.

I have a few questions.

All their examples have main as returning an int.
Returning a value from main, in a microcontroller is nonsensical, isn't it?
Where would it return that to?
Why would I want to spend four bytes of RAM on that?


Declaring a variable:
Does C (or Winavr) init a declared variable to some defined state
ALWAYS, or do I have to?
I don't mind doing it, and I'm sure that's absolutely safe, but I
don't want to do un-necessary operations.
Would the compiler be smart enough to take out a redundant init of a
variable? (assuming right after declaration)


-- 

"The very powerful and the very stupid have one thing in common. Instead of
altering their views to fit the facts, they alter the facts to fit their
views... which can be very uncomfortable if you happen to be one of the
facts that needs altering." Doctor Who, Face of Evil

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.