This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

On 09/09/15 14:54 +0100, Jonathan Wakely wrote:
On 08/09/15 21:52 +0200, François Dumont wrote:
Very good approach, I will start moving light checks from _GLIBCXX_DEBUG
implementation to normal one then.

Great, thanks. I *think* my patch got most of the lightweight checks

We could maybe include the irreflexivity checks, although it does
change the number of calls to the comparison function, which is not
allowed for some algorithms.

I'll commit my patch today.

I've committed the attached patch to trunk. It's the same as the
original one except for the tweaks to the docs in response to Daniel's
comment, and some whitespace changes in <valarray>.

I haven't made _FORTIFY_SOURCE enable these yet.

Tested powerpc64le-linux.

Here are some patches we should consider merging from the google

(The last two probably only work for unoptimized builds, but that may
still be useful).

Those are just ones I had in my mailbox, we should search for
__google_stl to find them all. Each should be considered individually,
I know I disliked some of the early patches when I first looked at
them years ago.

Discussion about enabling these checks automatically:

I'd forgotten about Oleg's suggestion of _GLIBCXX_DEBUG_LEVEL_N:
ANother option would be to support different checks depending on the
value of _GLIBCXX_ASSERTIONS=N, but I think for now we should keep it
simple and not complicate things like that. If these checks are light
enough then I think we only need two levels: cheap assertions and full
debug mode.

Attachment: patch.txt.bz2
Description: BZip2 compressed data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]