4 ms·
These "gotcha" optimizations are infuriating. Whether or not they're legal under the C standard, real-world _programmer_ mental computational models don't inclu
by quotemstr 12y ago
These "gotcha" optimizations are infuriating. Whether or not they're legal under the C standard, real-world _programmer_ mental computational models don't include a zero-length memset magically deleting NULL checks before and after the memset call. These optimizations are compiler bugs and need to be fixed.
Not everything the standard permits is in fact a good idea.
- chrisseaton 12y agoWhy not petition to change the standard if you think it's not ideal? If you change that then you don't have to argue with the compiler authors.
- quotemstr 12y agoWhy not both? Compilers have much faster turnaround times than language standards, and a compiler that declines to view memset as a NULL assertion is still perfectly conforming.