Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created August 24, 2016 12:10
Show Gist options
  • Save KristianLyng/582b4327012253e35b815c5f17f8347f to your computer and use it in GitHub Desktop.
Save KristianLyng/582b4327012253e35b815c5f17f8347f to your computer and use it in GitHub Desktop.
kly@leia:~$ cat foo.c
#include <stdio.h>
#include <limits.h>
int main(void) {
int i = INT_MAX;
if (i > i+1) {
printf("i is larger than i + 1\n");
} else {
printf("i is not larger than i + 1\n");
}
return 0;
}
kly@leia:~$ gcc foo.c
kly@leia:~$ ./a.out
i is larger than i + 1
kly@leia:~$ gcc -O2 foo.c
kly@leia:~$ ./a.out
i is not larger than i + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment