Last active
February 11, 2016 23:46
-
-
Save thestinger/8b3162c474b8b8410ebb 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
// Clang is clever enough to optimize out these malloc and free calls. | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) { | |
void *ptr = malloc(16); | |
if (!ptr) { | |
puts("side effect"); | |
return 1; | |
} | |
free(ptr); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment