This is the mail archive of the
mailing list for the libstdc++ project.
Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.
- From: FranÃois Dumont <frs dot dumont at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>, libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 8 Sep 2015 21:52:51 +0200
- Subject: Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.
- Authentication-results: sourceware.org; auth=none
- References: <20150907182755 dot GP2631 at redhat dot com>
On 07/09/2015 20:27, Jonathan Wakely wrote:
> This patch adds the "debug mode lite" we've been talking about, by
> changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS
> instead of _GLIBCXX_DEBUG (and making the latter imply the former).
> _GLIBCXX_ASSERTIONS is already used in Parallel Mode for enabling
> optional assertions (although some of them are O(n) and so we might
> want to change them to use another macro like _GLIBCXX_DEBUG or
> _GLIBCXX_PARALLEL_ASSERTIONS instead).
> With the change to define __glibcxx_assert() without Debug Mode we can
> change most uses of _GLIBCXX_DEBUG_ASSERT to simply __glibcxx_assert,
> so that the assertion is done when _GLIBCXX_ASSERTIONS is defined (not
> only in Debug Mode).
> I haven't added any new assertions yet, this just converts the
> lightweight Debug Mode checks, but the next step will be to add
> additional assertions to the (normal mode) containers. The google
> branches contain several good examples of checks to add.
> François, what do you think of this approach?
Very good approach, I will start moving light checks from _GLIBCXX_DEBUG
implementation to normal one then.