This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Debug Mode Lite
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 16 Jun 2014 20:05:18 +0200
- Subject: Re: Debug Mode Lite
- Authentication-results: sourceware.org; auth=none
- References: <CAH6eHdQRPp-cqFrekYDZHhpTh3yfssoyra3HsULwj+6sAMs=+Q at mail dot gmail dot com>
On Mon, 2014-06-16 at 08:30 +0100, Jonathan Wakely wrote:
> I think we should enable _GLIBCXX_ASSERT checks under more conditions,
> e.g. if the user defines _GLIBCXX_DEBUG_LITE, to enable all low-cost
> debug checks that have no ABI impact, such as range checks in vectors,
> non-null checks dereferencing smart pointers.
>
> The full _GLIBCXX_DEBUG mode alters too much and requires rebuilding
> all relevant objects.
>
> A lot of our existing _GLIBCXX_ASSERT checks are cheap anyway, the
> ones that aren't should be moved to a new macro that's only enable by
> the full _GLIBCXX_DEBUG macro. There are some interesting additional
> checks in the Google svn branch that should be turned on by the "lite"
> mode.
>
> (Please suggest a better name, I hate the word "Lite" :-)
How about _GLIBCXX_DEBUG_LEVEL_<N>? _GLIBCXX_DEBUG_LITE would be N = 0
and _GLIBCXX_DEBUG would be N = 1 or something like that. At least that
would leave room for future extensions to the checking granularity
without having to think about the names again :)
Cheers,
Oleg