Thread: Debug Mode Vs. Release Mode

  1. #1
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    Debug Mode Vs. Release Mode

    Why is it that sometimes when I compile in debug mode some parts of the program do not work, but when I am using release mode it works. For example some FILE I/O I was doing...
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  2. #2
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Well 15 views and no answer.......let me myself take a guess........is it because Debug Mode is more Strict?
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    Are you using g++?
    Try compiling with -Wall which will issue all warnings known.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    It means your program still has bugs - usually ones which relate in some way to abuse of memory
    Such as
    - running off the end of an array / allocated memory
    - use of uninitialised variables
    - dereference of a pointer before allocation or after free
    - assumptions about packing and or alignment

    > is it because Debug Mode is more Strict?
    Well it has more checks - in particular malloc and free typically have dead-mans-land zones at either end to detect overruns, and the contents are trashed as soon as you free it (to detect use-after-free errors)

    > Well 15 views and no answer
    Maybe so, but it's still a bump
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    Sometimes in VC++, I forget that I have specific libraries setup in Debug config, and don't remember to add them to the Release config. Same thing for certain preprocessors.

    May not be your problem, but I've done this more than a few times

  6. #6
    Registered User glUser3f's Avatar
    Join Date
    Aug 2003
    Posts
    345
    when it happens to me, most of the time it turns out to be an uninitialized variable issue.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 09-16-2006, 07:11 PM
  2. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 11:08 AM
  3. release vs debug mode
    By bithub in forum Tech Board
    Replies: 2
    Last Post: 05-10-2006, 03:31 PM
  4. Release vs. Debug mode builds
    By earth_angel in forum C++ Programming
    Replies: 5
    Last Post: 11-10-2005, 04:41 PM
  5. 2min in debug mode, 3sec in release!
    By glUser3f in forum C++ Programming
    Replies: 9
    Last Post: 10-03-2003, 01:00 PM