Works in debug and release builds with gcc.