Skip to content

Instantly share code, notes, and snippets.

@cjfuller
Created September 27, 2013 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjfuller/6732470 to your computer and use it in GitHub Desktop.
Save cjfuller/6732470 to your computer and use it in GitHub Desktop.
testing the effects of volatile
#include <stdlib.h>
typedef unsigned long VALUE;
int main() {
VALUE x = 0;
volatile VALUE y = 1;
VALUE* a = malloc(sizeof(VALUE));
volatile VALUE* b = malloc(sizeof(VALUE));
*b = x;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment