[PATCH] Fix -save-temps from clobbering input file@apple.com

Ira Ruben ira@apple.com
Thu Nov 1 10:50:00 GMT 2001


At 9:32 PM +0100 11/11/01, Andreas Schwab wrote:

>|> +		    strncpy ((char *)temp_filename, input_basename, basename_length);
>|> +		    strncpy ((char *)temp_filename + basename_length, suffix,
>|> +		   	     suffix_length);
>|> +		    *((char *)temp_filename + temp_filename_length) = '\0';
>
>You should temporarily use a different variable to remove the need for
>these casts.

And not using casts is wrong because...why?  I think it's fine the way it is.  Let code gen use temp variables if it feels it wants to (it shouldn't here though).  Using explicit variables to remove casts might be fine if used a LOT and where removing casting might clearify readability.  But not for only three lines where there's no confusion at all.  Let's not get into a stylistic debate here.

Ira



More information about the Gcc-patches mailing list