Boost logo

Boost :

Subject: Re: [boost] [explore] Library Proposal: Container Streaming
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-12-02 09:22:49

Mikael Olenfalk wrote:
> On Wed, Dec 2, 2009 at 8:06 AM, Vladimir Prus
> <vladimir_at_[hidden]> wrote:
> >>
> >> Let me check this. I am using -O2
> >
> > That's not debug build, for sure.
> The -O2 setting only controls optimization, the -g flag is for
> enabling debug. You can have debug builds and turn on optimization at
> the same time, check for the presence of the -g flag (presence =
> debug)

-g (equivalent to -g2) inserts debugging symbols, useful for debugging, but also for other purposes. That can be done for optimized and non-optimized builds. -O2 activates optimizations.

The notion of a debug or a release build is not intrinsic in GCC. The usual notion of a debug build implies no optimizations and the inclusion of debugging symbols. The usual notion of a release build implies optimizations and no debugging symbols. Combinations are possible (I usually include symbols in my release builds so core dumps and logged stack traces are more helpful to diagnose failures).

The standard refers to the manifest constant, NDEBUG, to control the behavior of assert. This manifest constant is usually co-opted to indicate a release build and another, such as _DEBUG or DEBUG, is used to indicate a debug build. Based upon the presence of those manifest constants, debugging only code may be included.

To compare the debug or optimized build effects of the proposed library and of Boost.Serialization requires agreeing on the options used, not just bandying about the terms "debug" and "release." (Never mind the need to agree on whether to examine the effects on debug or release builds.)

Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

Boost list run by bdawes at, gregod at, cpdaniel at, john at