Author Topic: release vs debug version  (Read 6217 times)

Offline maxcy

  • Multiple posting newcomer
  • *
  • Posts: 20
release vs debug version
« 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

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1563
Re: release vs debug version
« Reply #1 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".

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: release vs debug version
« Reply #2 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.

« Last Edit: October 11, 2023, 03:12:31 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline maxcy

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: release vs debug version
« Reply #3 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!!