3 ms·
LLVM is more interesting piece of software, gcc is kind of crusty and warty. Still, I'm glad you're interested in the language, if you're interested in undefin
by defrost 14y ago
LLVM is more interesting piece of software, gcc is kind of crusty and warty.
Still, I'm glad you're interested in the language, if you're interested in undefined behaviour then you should carefully and closely read the latest free draft standard (N1570) and perhaps implement a small C compiler of your own ( Appel : Modern Compiler Implementation ).
There are many C compilers, they are free to do whatever they want when behaviour is undefined and in many cases you'll unfortunately not see anything odd at all, not until you port your code, change your flags or upgrade the compiler and then you'll having a seething mass of "well this stuff worked when we tested it" errors.
Strapping yourself into a vehicle and driving off a cliff teaches you a little about the dangers of accidents and gives you a reason to drive safely, it doesn't particularly teach much about the practice of safe driving.
The example code drove off the road, what happened next really isn't all that exciting.
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
http://www.cs.princeton.edu/~appel/modern/c/ http://www.cs.princeton.edu/~appel/modern/c/
- dllthomas 14y agoMany serious pieces of software are crusty and warty.