3 ms·
Some buddies and I were messing around with ways we could sneakily inject one hidden #define somewhere in a C project to make it look like a segfault. We ended
by floppydisk 15y ago
Some buddies and I were messing around with ways we could sneakily inject one hidden #define somewhere in a C project to make it look like a segfault. We ended up with #define printf to print out "segfault" but GCC always threw warnings, so it didn't have much practicality for use in a joke.
- tedunangst 15y agoPre C99? Cheap hack using variadic macros: #define printf(...) printf(__VA_ARGS__); puts("\n\n\n\nFAIL!")
- floppydisk 15y agoYes, pre-C99. I'm going to have to try that now.