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]

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


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


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