Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created October 28, 2015 09:47
Show Gist options
  • Select an option

  • Save KristianLyng/a83f126c2cbb0da51aa3 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/a83f126c2cbb0da51aa3 to your computer and use it in GitHub Desktop.
$ gcc -O0 foo.c -o test-O0
$ gcc -O2 foo.c -o test-O2
$ ./test-O0
intmax_t x = LONG_MAX;
uintmax_t y = ULONG_MAX;
x > x+1: true
y > y+1: true
$ ./test-O2
intmax_t x = LONG_MAX;
uintmax_t y = ULONG_MAX;
x > x+1: false
y > y+1: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment