Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: dominover on July 15, 2014, 10:15:08 am
-
In the compiler flags for Code::Blocks version 13.12 the flag Optimize even more (for speed) [-02] is checked for Release Versions.
While my program will compile fine (without errors) when this is checked, I get a fatal error during run-time.
I have subsequently unticked this box. Deleted the object files and recompiled the program and it works fine during run-time. I'm wondering why this would cause an error? Are there any common reasons why this would happen?
Thanks
Dom
-
I have never had this problem; but, the posts I read about others having it are:
1. Compiler Bug
2. User code does something undefined by the C/C++ standard therefore user error.
Neither of the above causes are things permitted on this forum. http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)
I can think of no other causes of this bug.
Tim S.
-
Hmm.. Thanks.. I have never had it before so it's a complete mystery.
I know that debug versions can mask certain errors but in this case there doesn't seem to be any.
A complete mystery ???
-
This is most probably some uninitialized variable or memory somewhere in your program.
If you're using threads it might be some race condition.
There are plenty of tools you can use to find it: compiler warning, debugger, printf, valgrind, clang address sanitizer, etc...