Last active
February 9, 2020 17:56
-
-
Save kevinushey/cfa848be2d39ddd110f893d9b6c5ac9c to your computer and use it in GitHub Desktop.
Fails to compile with gcc 10 on Fedora Rawhide.
This file contains hidden or 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
void* callback(const char* name); | |
extern "C" { | |
inline void f1() | |
{ | |
static void (*f)(); | |
f = (void(*)()) callback("f1"); | |
f(); | |
} | |
inline void f2() | |
{ | |
static void (*f)(); | |
f = (void(*)()) callback("f2"); | |
f(); | |
} | |
} // extern "C" | |
int main() | |
{ | |
f1(); | |
f2(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've removed the implementation of
callback()
so at least this should no longer be UB. The underlying issue though is as @Enchufa2 says, with duplicate (and non-mangled) names forf
generated.