On 08/09/15 15:14 +0200, Michael Matz wrote:
Hi,
On Mon, 7 Sep 2015, Jonathan Wakely wrote:
> Interesting. Is this mode ABI-compatible with the default mode?
Yes, that's the main reason I want to make this change.
> Should _FORTIFY_SOURCE imply _GLIBCXX_ASSERTIONS?
Yes, I think it should.
Then at least those assertions that lie in a different big-O complexity
class have to be moved away from _GLIBCXX_ASSERTIONS (as hinted in your
initial mail). Some distros build packages with _FORTIFY_SOURCE, and
while additional asserts seem acceptable, going from constant to linear
(or the like) seems not.
Agreed.
AFAIK no distros have anything that depends on the libstdc++ Parallel
Mode (which enables O(n) checks under _GLIBCXX_ASSERTIONS), but as I
suggested I think those should be moved to another macro anyway.
Anything currently enabled by _GLIBCXX_DEBUG that changes the big-O
complexity is not touched by my patch, so wouldn't be enabled by
_GLIBCXX_ASSERTIONS. That's by design.
The existing _GLIBCXX_DEBUG Debug Mode is very important, and far more
powerful than the checks enabled by _GLIBCXX_ASSERTIONS will ever be,
but the ABI impact and the violations of the standard's complexity
guarantees mean that there are places it can't be used. For
_GLIBCXX_ASSERTIONS to be worthwhile it has to be usable in almost any
situations. In particular it should be reasonable to build entire
distros with those checks enabled.