WWDC 2006 2007 2008 2009 2010 2011 2012 2013 2014
Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.
In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.
Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th
The C standard only specifies minimum limits for the values of character types and standard integer types. This makes it possible to generate efficient code on diverse architectures, but can pose problematic if your code expects the limits to match your development platform, or if you have to do low-level things.
Before C99, the usual way to solve this was to use typedef to declare synonyms
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict | |
This file remaps the key bindings of a single user on Mac OS X 10.5 to more | |
closely match default behavior on Windows systems. This makes the Command key | |
behave like Windows Control key. To use Control instead of Command, either swap | |
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys... | |
or replace @ with ^ in this file. | |
Here is a rough cheatsheet for syntax. | |
Key Modifiers |