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


On Mon, Oct 29, 2001 at 01:37:18PM -0800, Ira Ruben wrote:
> There is the possibility that the user's input file can be clobbered
> by the compiler's intermediate files when -save-temps is used.
> For example gcc -save-temps foo.s will cause the preprocessed
> output of foo.s to overwrite foo.s.  This patch corrects that
> by checking for such cases and using a temp file instead.

Is there a portable and reliable way we can tell if we got the
input file via a "different" name?  I.e. take into account case
sensitivity and 8.3?  

My thought was use fstat and compare st_dev+st_ino numbers, but
I don't know how reliable that is on various non-POSIX filesystems.


r~


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