-
-
Save threedaymonk/5043381 to your computer and use it in GitHub Desktop.
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
# gccmock - generate exploding link stubs from linker error messages | |
# | |
# Usage: gcc [files] 2>&1 | ruby gccmock.rb > [filename].c | |
LINK_SYMBOL = /"_([_a-z0-9]*)",/ | |
puts "#include <assert.h>" | |
puts "#define EXPLODE(name) void name() { assert(!\"unexpected call\"); }" | |
puts *ARGF.read.scan(LINK_SYMBOL).map { |a| "EXPLODE(#{a[0]})" }.sort.uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is actually longer than my previous version, but the
$1
ingrep
doesn't feel very pure.