#ifdef's ignored by the Arduino pre-processor, linking additional libraries. [imported] #906
Labels
Component: Preprocessor
The Arduino sketch preprocessor converts .ino files into C++ code before compilation
Milestone
This is Issue 906 moved from a Google Code project.
Added by 2012-05-05T01:37:44.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.
Original labels: Type-Defect, Priority-Medium, Component-IDE
Original description
undef NOTDEF
ifdef NOTDEF
include <Wire.h>
endif
The I2C/TWI Wire library (in this example) still gets included even with the above code. In fact, any #include that begins at the start of a line causes the corresponding library to get loaded, even if the #includes are surrounded by /* and */ comment tokens on lines before and after the #include. This makes it more difficult to modularize code in memory-constrained environments.
What is the expected output?
The expected behavior is that any code or compiler directive should not be honored if it is part of a /* */ comment or #if/#ifdef code block that does not evaluate to true.
This behavior was observed on Arduino 1.0 running on Mac OS X 10.6.8.
It is not specific to any particular Arduino board.
The text was updated successfully, but these errors were encountered: