Skip to content

Instantly share code, notes, and snippets.

@rnapier
Created December 31, 2013 22:10
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 rnapier/8202731 to your computer and use it in GitHub Desktop.
Save rnapier/8202731 to your computer and use it in GitHub Desktop.
Demonstrates that structs are not initialized under ARC. Run in Release.
int main(int argc, const char * argv[]) {
@autoreleasepool {
struct Stuff {
int x;
int y;
};
int x;
struct Stuff s;
printf("%d:%d\n", x, s.y);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment