This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -save-temps from clobbering input file@apple.com
- To: Ira Ruben <ira at apple dot com>
- Subject: Re: [PATCH] Fix -save-temps from clobbering input file@apple.com
- From: Richard Henderson <rth at redhat dot com>
- Date: Sat, 3 Nov 2001 13:33:26 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- References: <p05100300b80370dcbd9d@[17.202.44.152]>
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~