This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Debug mode output broken
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: Kaspar Fischer <kasparfischer at gmx dot net>, libstdc++ at gcc dot gnu dot org,Jonathan Wakely <cow at compsoc dot man dot ac dot uk>,Jonathan Wakely <jwakely at mintel dot com>
- Date: Fri, 06 Aug 2004 18:45:29 +0200
- Subject: Re: Debug mode output broken
- References: <5637.1091803831@www56.gmx.net> <4113A6FF.6070905@suse.de>
Paolo Carlini wrote:
Jonathan, everything considered (simplicity, affecting only
!_GLIBCXX_USE_C99,
code not performance critical since we are in debug mode, ...) I think
that, after all,
your very first solution is the best one. If you don't hear other
comments during
the next hours please apply it after due testing. Remember, however,
to add a comment,
mentioning the special case of _M_print_string, and remove the
__attribute__((__unused__)),
not needed anymore.
Actually, Jonathan, sorry but the patch is still not ok: in general it
works fine but without
the equivalent of __n in snprintf, we are always at risk of overflowing
__buf, since sprintf
stops only when it sees \0. A possible solution would be, as you said,
enforcing strlen(__string)
< __bufsize but this limitation was not present in the original code and
I don't like adding it.
We have to figure out something more involved, similar to your last
proposal, I'm afraid.
Paolo.