Last active
May 4, 2019 18:30
-
-
Save tablatronix/b6378b05ba94e64ca48d76cd06df6b8f to your computer and use it in GitHub Desktop.
linkerprobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//COMPILES | |
#ifndef SOMEDEF | |
void initstuff(){ | |
} | |
#endif | |
#ifdef SOMEDEF | |
void initstuff(){ | |
} | |
#endif | |
// DOES NOT COMPILE | |
#ifdef SOMEDEF | |
void initstuff(){ | |
} | |
#endif | |
#ifndef SOMEDEF | |
void initstuff(){ | |
} | |
#endif | |
// DOES NOT COMPILE | |
#ifdef SOMEDEF | |
void initstuff(){ | |
} | |
#else | |
void initstuff(){ | |
} | |
#endif | |
// COMPILES | |
#ifndef SOMEDEF | |
void initstuff(){ | |
} | |
#else | |
void initstuff(){ | |
} | |
#endif |
I am going to guess that ifdef check still sees the function def and does something when it sees the second, what is odd is that there is no error related to that, there is only a bunch of
error: 'whatnot' was not declared in this scope
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
as in not compiles, compiler throws errors of things not in scope of stuff after block