Skip to content

Instantly share code, notes, and snippets.

@tablatronix
Last active May 4, 2019 18:30
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

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