https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86842

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=60519,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=56109
           Severity|normal                      |enhancement

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to fiesh from comment #0)
> It would be great if there was a means to activate run-time assertions on
> these preconditions, as well as on postconditions.  In terms of
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf ,
> everything listed as "Expects:" and "Ensures:" could be checked by a
> run-time check.

Not everything. Some Expects preconditions cannot be tested (e.g. that pointer
points to an array of at least N objects).

> Since in general checking a sentence with n universal quantifiers will
> result in O(N^n) many operations, it might be meaningful to separate those
> by different macros, allowing the user control over the amount of complexity
> degradation they allow for their debug build.

That sounds like a maintenance nightmare.

Reply via email to