From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Koenig To: egcs@cygnus.com Subject: Re: Mini-patch for cccp.c Date: Mon, 06 Oct 1997 08:25:00 -0000 Message-ID: <199709301508.QAA02218@mvmap66.ciw.uni-karlsruhe.de> X-SW-Source: 1997-10/msg00222.html Message-ID: <19971006082500.k8QqzENJkFLdntzMjFnh4IWcV9LAjny0xXiO5DAFGi0@z> I wrote: [...] Playing around with checkergcc some more, I found that expand_to_temp_buffer didn't initialize some of the members of the FILE_BUF it returns. Dunno wether this has any grave consequences, but I think it's a bad idea just on general principles. Below is a patch against the origninal 970924 cccp.c which fixes this (it also includes the previous patch). Tue Sep 30 16:50:55 CEST 1997 Thomas Koenig (ig25@rz.uni-karlsruhe.de) * cccp.c: (struct file_buf) change system_header_p to int (expand_to_temp_buffer) initialize all members of obuf static int last_error_tick; /* Incremented each time we print it. */ --- cccp.c.orig Tue Sep 30 14:43:08 1997 +++ cccp.c Tue Sep 30 16:05:35 1997 @@ -519,7 +519,7 @@ /* Object to be freed at end of input at this level. */ U_CHAR *free_ptr; /* True if this is a header file included using . */ - char system_header_p; + int system_header_p; } instack[INPUT_STACK_MAX]; static int last_error_tick; /* Incremented each time we print it. */ @@ -3549,9 +3549,14 @@ obuf.length = length * 2 + 100; /* Usually enough. Why be stingy? */ obuf.bufp = obuf.buf = (U_CHAR *) xmalloc (obuf.length); + obuf.nominal_fname = 0; + obuf.inc = 0; + obuf.dir = 0; obuf.fname = 0; obuf.macro = 0; + obuf.if_stack = 0; obuf.free_ptr = 0; + obuf.system_header_p = 0; CHECK_DEPTH ({return obuf;}); -- Thomas Koenig, Thomas.Koenig@ciw.uni-karlsruhe.de, ig25@dkauni2.bitnet. The joy of engineering is to find a straight line on a double logarithmic diagram.