This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to initialize pretty_printer's line_length
- From: Per Bothner <per at bothner dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Gabriel Dos Reis <gcc at integrable-solutions dot net>
- Date: Fri, 12 Sep 2003 12:01:11 -0700
- Subject: Re: PATCH to initialize pretty_printer's line_length
- References: <3F615D4F.8090005@bothner.com> <wvlk78ek17x.fsf@prospero.boston.redhat.com>
Jason Merrill wrote:
Instead, please change the xmalloc for the buffer to use xcalloc so that
this won't break the next time someone adds a field.
I remember arguing with H.J.Lu that this was just papering over
problems. (It will break on systems where NULLs aren't all
zero bits, for example - not that we support such systems.)
Worse, explicit initialization forces people to think about
the correct initial value.
How about an alternative idea, where if ENABLE_CHECKING is on
then we re-define xmalloc so it that memsets the returned
block with 0xD1 or something like that?
--
--Per Bothner
per@bothner.com http://per.bothner.com/