This is the mail archive of the
mailing list for the libstdc++ project.
Re: New istreambuf_iterator debug check
- From: François Dumont <frs dot dumont at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 31 Jan 2018 18:01:50 +0100
- Subject: Re: New istreambuf_iterator debug check
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <20180129135209.GN3417@redhat.com>
On 29/01/2018 14:52, Jonathan Wakely wrote:
On 24/01/18 17:39 +0100, François Dumont wrote:
I'd like to propose this new debug check. Comparing with non-eos
istreambuf_iterator sounds like an obvious coding mistake.
Agreed, but that doesn't mean we can terminate the process. It's still
valid C++, even though it's probably not what the author intended to do.
Maybe we should introduce an extended debug mode to check this kind of
mistake even if Standard compliant.
Maybe check the _GLIBCXX_DEBUG value, activating it only if 2. Or
introduce yet another macro like _GLIBCXX_CHECK ? Or we could combine
_GLIBCXX_DEBUG with another existing macro to activate this check ?
Unless you prefer we simply don't introduce this kind of check.