473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Debug vs. Release

Sorry for the lame question but, what's the difference between Debug
and Release versions?
Nov 14 '05 #1
7 2566
te***********@yahoo.com (Techno Learner) writes:
Sorry for the lame question but, what's the difference between Debug
and Release versions?


Your question is outside the domain of comp.lang.c, which discusses
only the standard C programming language, including the standard C
library. This is a remarkably narrow topic compared to what many
people expect.

For your convenience, the list below contains topics that are not
on-topic for comp.lang.c, and suggests newsgroups for you to explore
if you have questions about these topics. Please do observe proper
netiquette before posting to any of these newsgroups. In particular,
you should read the group's charter and FAQ, if any (FAQs are
available from www.faqs.org and other sources). If those fail to
answer your question then you should browse through at least two weeks
of recent articles to make sure that your question has not already
been answered.

* OS-specific questions, such as how to clear the screen,
access the network, list the files in a directory, or read
"piped" output from a subprocess. These questions should be
directed to OS-specific newsgroups, such as
comp.os.ms-windows.programmer.misc, comp.unix.programmer, or
comp.os.linux.development.apps.

* Compiler-specific questions, such as installation issues and
locations of header files. Ask about these in
compiler-specific newsgroups, such as gnu.gcc.help or
comp.os.ms-windows.programmer.misc. Questions about writing
compilers are appropriate in comp.compilers.

* Processor-specific questions, such as questions about
assembly and machine code. x86 questions are appropriate in
comp.lang.asm.x86, embedded system processor questions may
be appropriate in comp.arch.embedded.

* ABI-specific questions, such as how to interface assembly
code to C. These questions are both processor- and
OS-specific and should typically be asked in OS-specific
newsgroups.

* Algorithms, except questions about C implementations of
algorithms. "How do I implement algorithm X in C?" is not a
question about a C implementation of an algorithm, it is a
request for source code. Newsgroups comp.programming and
comp.theory may be appropriate.

* Making C interoperate with other languages. C has no
facilities for such interoperation. These questions should
be directed to system- or compiler-specific newsgroups. C++
has features for interoperating with C, so consider
comp.lang.c++ for such questions.

* The C standard, as opposed to standard C. Questions about
the C standard are best asked in comp.std.c.

* C++. Please do not post or cross-post questions about C++
to comp.lang.c. Ask C++ questions in C++ newsgroups, such
as comp.lang.c++ or comp.lang.c++.moderated.

* Test posts. Please test in a newsgroup meant for testing,
such as alt.test.

news.groups.questions is a good place to ask about the appropriate
newsgroup for a given topic.

--
"This is a wonderful answer.
It's off-topic, it's incorrect, and it doesn't answer the question."
--Richard Heathfield
Nov 14 '05 #2

"Techno Learner" <te***********@yahoo.com> wrote in message
Sorry for the lame question but, what's the difference between
Debug and Release versions?

Its compiler-specific. Because of the way debuggers work, it is often useful
to have two compilation schemes, one to provide the optimal environment for
the debugger, and one to produce the smallest and fastest possible
executable for release. For instance, if the optimiser collapses several
nested functions into one, it is usually very difficult for the debugger to
tell in which function an illegal operation occurred, so this optimisation
won't be performed for the "debug" build.

Another optimisation is with memory management. Under debug memory returned
from malloc() is often set to a pattern like CECE which is designed to be
easily recognisable, and to produce large negative numbers - obvious garbage
and highly likely to cause address errors if used to calcualte arrays. This
makes sense, since you want to pick up errors. Under release, however, you
want to suppress errors if they exist, so malloc() can return memory
initialised to zero. Similarly, free() under debug should shred garbage,
whlst under release it shouldn't, so that if the program accidentally
references freed memory it has a sporting chance of recovery.

These rules apply to games, where you want to avoid a crash at all costs. In
safety-critical code a suppress errors aproach isn't acceptable.
Nov 14 '05 #3
"Ben Pfaff" <bl*@cs.stanford.edu> wrote in message news:87************@blp.benpfaff.org...
te***********@yahoo.com (Techno Learner) writes:
Sorry for the lame question but, what's the difference between Debug
and Release versions?


Your question is outside the domain of comp.lang.c, ...


I disagree. The broader aspects yes, but C does have <assert.h>. The difference between a
debug and release version can be made in terms of NDEBUG.

--
Peter
Nov 14 '05 #4
Peter Nilsson wrote:
"Ben Pfaff" <bl*@cs.stanford.edu> wrote in message
te***********@yahoo.com (Techno Learner) writes:
Sorry for the lame question but, what's the difference between
Debug and Release versions?


Your question is outside the domain of comp.lang.c, ...


I disagree. The broader aspects yes, but C does have <assert.h>.
The difference between a debug and release version can be made
in terms of NDEBUG.


AFAIK the only thing NDEBUG affects is the assert macro in
assert.h. That doesn't prevent the user examining or setting its
value, however. The OP is probably thinking about the way the MSC
IDE works, which is very far off topic here, and he should to to a
Microsoft newsgroup of some kind.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 14 '05 #5

"CBFalconer" <cb********@yahoo.com> wrote in message

The OP is probably thinking about the way the MSC
IDE works, which is very far off topic here, and he should to to > a Microsoft newsgroup of some kind.

MSC isn't "very far off topic", as a discussion of, say, knitting would be.
It's a related topic that falls out of the boundaries of the group, like,
say, prime number determining algorithms.

However the release and debug builds are a function of the compiler, they
just happen to be set by options in the IDE. A description of exactly what
the MS compiler does is too specific for comp.lang.c, but a general
discussion of why compilers often provide debug and release options is I
think reasonably on-topic.
Nov 14 '05 #6
Typically, a Debug release would define a flag like _DEBUG in the
make file. This will include assert and other macros in the final
code.

In the release mode, _DEBUG would not be defined. And the assert
macros will map to blank.

The following article provides an example:

http://www.eventhelix.com/RealtimeMa...y_contract.htm

Sandeep
--
http://www.EventHelix.com/EventStudio
EventStudio 2.0 - Generate Sequence Diagrams in PDF (no drawing necessary)
Nov 14 '05 #7
In article <56**************************@posting.google.com >,
ev********@hotmail.com says...
In the release mode, _DEBUG would not be defined. And the assert
macros will map to blank.


You might want to look up NDEBUG instead.

Nov 14 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Srinivasa Rao | last post by:
I have read in one article that when we compile the application in release mode, all the debug classes and properties will be automatically removed from the code. I tried to implement this thing by...
9
by: dee | last post by:
Hi I'm about to upload my site and I have switched to release version. Is that enough or do I still need to disable <compilation defaultLanguage="vb" debug="true" /> the debug="true" in the .pdb...
3
by: | last post by:
Since I need to dotfuscate my exe file anyway, does it make any difference if I use Debug or Release versions. Would a Debug version be easier to decompile/study/reverse engineer than a Release...
1
by: Epetruk | last post by:
Hello, In VS2003, I used to have two solutions - a debug and release solution. Each solution had a webservice project and several other class library projects. The webservice project...
2
by: Epetruk | last post by:
Hello, I have a problem where an application I am working on throws an OutOfMemoryException when I run it in Release mode, whereas it doesn't do this when I am running in Debug. The...
6
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++...
3
by: Bob Johnson | last post by:
It is my understanding - and please correct me if I'm wrong - that when building a project in debug mode, I can deploy the .pdb file along with the ..exe and thereby have access to the specific...
3
by: TBass | last post by:
Hello, Is there a way to get Visual Studio 2003 look to one directory for debug version dlls when set to DEBUG and then to another directory where I store the release version of a dll when set...
2
by: Dave Johansen | last post by:
I just converted a solution from Visual Studio 2003 to Visual Studio 2005 and the Debug mode seems to be running just fine, but the Release mode crashes on the following code: std::ifstream...
3
by: =?Utf-8?B?bG10dGFn?= | last post by:
We have developed a number of different applications (ASP.NET web site, Windows services, DLLs, Windows forms, etc.) in C# 2.0. We have developed and unit tested all these applications/components...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.