This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH to initialize pretty_printer's line_length


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/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]