This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/86842] Allow run-time checks of pre- and postconditions
- From: "fiesh at zefix dot tv" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 03 Aug 2018 14:33:16 +0000
- Subject: [Bug libstdc++/86842] Allow run-time checks of pre- and postconditions
- Auto-submitted: auto-generated
- References: <bug-86842-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86842
--- Comment #4 from fiesh at zefix dot tv ---
> So I'm strongly opposed to that part of the suggestion. Either you get all the ABI-preserving debug checks, or none.
Checking all (possible) preconditions without any limit on the introduced
complexity might not be possible within reasonable time. Checking transitivity
naively is O(N^3). Maybe there's a better way to check something is a strict
weak ordering, but in general there might always be a sentence whose veracity
cannot be established more efficiently.
So if the library wanted to provide checks for every precondition that can be
verified (which was my original proposition), I don't see how it's possible
meaningfully without any restriction on the computational efforts spent.