Skip to content

Instantly share code, notes, and snippets.

@mikeando
Created June 24, 2011 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeando/1044114 to your computer and use it in GitHub Desktop.
Save mikeando/1044114 to your computer and use it in GitHub Desktop.
Example for failing compile on system symbol usage
void not_thread_safe();
void puts() { not_thread_safe(); }
all: should_work.x should_fail.x
should_fail.x : should_fail.o fncheck.o
gcc should_fail.o fncheck.o -Xlinker -dead_strip -o should_fail.x
should_work.x : should_work.o fncheck.o
gcc should_work.o fncheck.o -Xlinker -dead_strip -o should_work.x
should_fail.o : should_fail.c
gcc -c should_fail.c
should_work.o : should_work.c
gcc -c should_work.c
fncheck.o : fncheck.c
gcc -c fncheck.c
#include <stdio.h>
int main (int argc, char *argv[]) {
printf ("Hello, world.\n");
return 0;
}
#include <stdio.h>
int main (int argc, char *argv[]) {
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment