Created
September 11, 2019 14:23
-
-
Save neunhoef/37577a5def5eb25791a1aadab21d9177 to your computer and use it in GitHub Desktop.
Expose a problem on Alpine Linux and g++ and static linking
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
#include <pthread.h> | |
#ifdef REPAIR | |
void* g(void *p) { | |
return p; | |
} | |
void f() { | |
pthread_t t; | |
pthread_create(&t, nullptr, g, nullptr); | |
pthread_cancel(t); | |
pthread_join(t, nullptr); | |
} | |
#endif | |
int main(int argc, char*[]) { | |
#ifdef REPAIR | |
if (argc == -1) { f(); } | |
#endif | |
try { throw 42; } catch(int const& i) {}; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment