Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: maxcy on September 27, 2023, 03:40:26 am

Title: release vs debug version
Post by: maxcy on September 27, 2023, 03:40:26 am
 :) I have no idea how to go about searching for an answer to my compiler problem!!! I have a fairly large writing a compiler project, I have the code all finished, so it's time to compile it. I did just that for a release version as well as a debugger version. When I run the degub code version all is well!  When I try to run the release version the program comes to an abrupt exit!  Same code, different compiler run time results.  I have no idea what to do to troubleshoot this!
maxcy
Title: Re: release vs debug version
Post by: Miguel Gimenez on September 27, 2023, 10:01:05 am
Differences among release and debug binaries are optimizations and memory layout, if the release is crashing I would look for a memory corruption. Also exception processing may be different.

You can locate the exit point using intermediate check points, like printing "Phase 1 start" in the console (or a log file) and later "Phase 1 end".
Title: Re: release vs debug version
Post by: stahta01 on September 27, 2023, 10:56:52 am
Turn up the warnings and look for un-initialized variables esp. pointers.

Edit: My post was not to be used instead of but in addition to the prior post

Tim S.

Title: Re: release vs debug version
Post by: maxcy on October 11, 2023, 12:12:01 am
I did look at all the warnings and found ONE about a potentially unused variable. (xref.png) Looking at the attached code I found the variable declared, then initialized using strcmp. I then found this variable used 3 times later in the code. So I ignored this warning.  I did take out the -x (cross ref option) and ran the code once again. Now there is no problem running all the code! But the xref section of the code is obviously not running!!