|
|
|
|
|
by dwyer
4271 days ago
|
|
Just yesterday I was debugging a piece of code I was writing. I started with a printf where I suspected a segfault was occurring. printf(...);
for (...) {...}
The printf never executed. So I fired up gdb and confirmed the segfault was happening where I thought it was, but the for loop was being initialized before the printf. Even with debugging on and optimization off. Could be a bug in clang (I didn't think to try it with gcc), but even so it shows that the way things should work in theory don't necessarily dictate the way they do work in practice. |
|