windows xp, I just downloaded the june 1st nightly build and it still does it.
Yes it is a bug. In your code though, not in Code::Blocks.
You cannot set signal handlers under Windows. This is a no-op. Therefore it still crashes, and hence the exit code.
EDIT:Strictly speaking, the above is not correct, you
can set signal handlers. However, this is a Windows XP feature which is not backwards-compatible, and you have to use Windows API calls for that. POSIX calls don't do anything (unless maybe you have this special Unix compatibility toolkit from Microsoft, I don't know about that).
The MSVC compiler has some builtin functionality that installs structured exception handlers behind the scenes, but this again only works under Windows XP and is non-standard (look on MSDN if you're interested in that).