News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

release vs debug version

Started by maxcy, September 27, 2023, 03:40:26 AM

Previous topic - Next topic

maxcy

 :) 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

Miguel Gimenez

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".

stahta01

#2
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.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

maxcy

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!!