Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional library include statements incorrectly cause that library to be linked in. #4126

Closed
SlashDevin opened this issue Nov 10, 2015 · 2 comments
Milestone

Comments

@SlashDevin
Copy link

Consider this simplified example:

#if 0
  #include <NeoHWSerial.h>
#endif

void setup()
{
  Serial.begin( 9600 );
}

void loop() {}

This forces the NeoHWSerial library to be linked in, even when the condition is FALSE and there are no compile-time references to that library.

As a result, ISRs in HardwareSerial (via 'Serial') conflict with the same ISRs in the incorrectly linked-in NeoHWSerial. Simply commenting out the NeoHWSerial include statement removes the "require" of that library, and HardwareSerial links in correctly, as the only source of the ISRs:

#if 0
  //#include <NeoHWSerial.h>
#endif

void setup()
{
  Serial.begin( 9600 );
}

void loop() {}

I found this on 1.0.5 and reproduced it on 1.6.5r2

@matthijskooijman
Copy link
Collaborator

Could you try 1.6.6? I think this was solved in that version.

@SlashDevin
Copy link
Author

Yep, fixed. Thanks!

@ffissore ffissore modified the milestone: Release 1.6.7 Nov 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants