Pages: 1 [2]   Go Down
Author Topic: Error when Using #define to set pins  (Read 1136 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12737
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I wonder if this would work if you set the compiler optimization off/to their lowest setting?

Yes.  With optimizations turned off the dead code is eliminated.  Oddly, a full stack frame is generated (which is dead code in my test case (but unrelated to the test)).

Quote

I suspect crippling bugs with the preprocessor can also be found.   smiley-wink
Logged

Offline Offline
God Member
*****
Karma: 32
Posts: 828
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I suspect crippling bugs with the preprocessor can also be found.   smiley-wink

Of course, but my point is that it is inherently a more difficult thing to accurately identify and eliminate dead code than it is to process text with preprocessing directives. I would _expect_ the dead code to be eliminated by a decent compiler, but without the same confidence I would have with the preprocessor.

« Last Edit: November 26, 2012, 07:08:05 am by pico » Logged

WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's starting to make sense to me, now! Thanks again for all the help. I think I need to find some good text books that cover the basics of micro-controllers and IDEs/programming. I feel like my knowledge of the Arduino (both the IDE and hardware) is analogous to most people's knowledge of their car. They know how to drive it reasonably well and they have a conceptual understanding of how their engine and transmission work but that's it; they can't fix it if it quits. That's how I am on the Arduino - a lot of it is obscured by a black box of ignorance!
« Last Edit: November 26, 2012, 12:42:00 pm by tms8c8 » Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The good news it it's C/C++ witha few additions, so you'll find plenty of documentation for the language fundamentals.
Logged

Pages: 1 [2]   Go Up
Jump to: