jung6717 / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

#ifdef __SOMETHINGNOTDEFINED ... void loop() ... #endif GIVES #206

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. #undef TOTO (just to make sure TOTO is not defined!!)
2. #ifdef TOTO
3. void loop () {

Basically it looks like the "preprocessor" (call it like you want it) 
burps when it sees "loop" or "setup" EVEN IF there's a #ifdef that 
prevents the compiler to "compile" the code.  True "loop() / setup()" is 
defined earlier BUT the #ifdef shouldn't make the IDE burps.

What is the expected output? What do you see instead?

error: new declaration 'int loop()
error: new declaration 'int setup()

What version of the Arduino software are you using? On what operating
system?  Which Arduino board are you using?

0018

Please provide any additional information below.

Original issue reported on code.google.com by pierre.b...@gmail.com on 18 Feb 2010 at 2:51

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
There's a work-around. Simply add at the very beginning of the sketch

int dummy;

This is only a work-around. Arduino IDE deserves a better solution.

Tested with 0022.

Could you please give this ticket with higher priority?

Original comment by Vilo.Rei on 8 Aug 2011 at 3:56

GoogleCodeExporter commented 8 years ago

Original comment by dmel...@gmail.com on 8 Aug 2011 at 5:44