[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: assert() vs. return(error)

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-02-23 13:58:03 CET

Stuart Celarier wrote:
>
>>Another common difference between debug and release versions is that the
>>latter doesn't contain debug information.
>
> Arguably common, but certainly not required. [...]
>
> Reiterating from my previous post, the fundamental difference between
> release and debug builds is whether optimization is performed or not.

That's typically another major difference, but none of these is "the
fundamental" difference. People define a "debug" mode and a "release" mode to
do what they want. Some people want the same level of debug information in
both modes, others want less (which is not necessarily none at all) in the
"release" version. Some people want the same optimisation level in both modes,
others don't. Some people want other differences, such as linking to "debug"
versions of external libraries, or having their own debugging mechanisms such
as "assert" and "debug_printf" enabled, and so on. It's just a convention
whereby people often want two types of build. Some people want more than two
types of build, and they either define more "build modes" or just change the
relevant settings in their build configuration for one of these modes and re-build.

In other words, there's no canonical definition, they're just labels for
user-defined configurations, with the implication that one is better suitable
to debugging and the other better suited to shipping.

> So I am confused: are people saying that Subversion is never compiled
> for release? Wouldn't that mean that compiler optimizations are not
> performed? If so, what would justify that?

When people say things like, "I always build Subversion with assertions
enabled" they mean either they only build in "debug" mode or they configured
"release" mode such that assertions are enabled. You can't tell which.

If someone were to say, rather bizarrely, "Subversion is never compiled for
release," it would not necessarily mean that optimisation is disabled. I
believe the default "debug" configuration has optimisation enabled. Yes, that
makes debugging harder, but the developer is free to change that setting and I
sometimes do.

So, in summary, you can't assume that "debug mode" or "release mode" means
anything in particular without knowing how the build is actually configured.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 23 13:58:33 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.