Skip to content

Instantly share code, notes, and snippets.

@tablatronix
Last active May 4, 2019 18:30
Show Gist options
  • Save tablatronix/b6378b05ba94e64ca48d76cd06df6b8f to your computer and use it in GitHub Desktop.
Save tablatronix/b6378b05ba94e64ca48d76cd06df6b8f to your computer and use it in GitHub Desktop.
linkerprobs
//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
@tablatronix
Copy link
Author

as in not compiles, compiler throws errors of things not in scope of stuff after block

@tablatronix
Copy link
Author

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