Skip to content

Instantly share code, notes, and snippets.

@zmughal
Last active December 31, 2015 07:39
Show Gist options
  • Save zmughal/7955761 to your computer and use it in GitHub Desktop.
Save zmughal/7955761 to your computer and use it in GitHub Desktop.
/* see <http://stackoverflow.com/questions/1694164/is-errno-thread-safe> */
#include <stdio.h>
#include <stdlib.h>
#define mem (*set_it())
int memory;
int* set_it() {
return &memory;
}
int main() {
mem = 2;
printf("mem: %d\n", mem);
mem = 4;
printf("mem: %d\n", mem);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment