This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix driver/39293
- From: Ian Lance Taylor <iant at google dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 02 Mar 2009 15:47:56 -0800
- Subject: Re: [PATCH] Fix driver/39293
- References: <20090228010000.GA25597@hungry-tiger.westford.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com> writes:
> This patch fixes bug 39293 by remembering the directory specified by an -o
> switch, adding a new spec code '%p' to emit this directory, including
> separator, and adding the %p's inside every %{save-temps} operation.
This is a change in current behaviour. Are we sure that this change is
desirable? Is anybody concerned by the change?
> + /* Store output directory name so that we can put -save-temps files
> + in the output directory, rather than the current directory. */
> + if (! output_dir_length)
Current gcc style calls for no space after the '!'.
> + {
> + const char *begin = (p[1] == 0) ? argv[i+1] : p+1;
> + const char *begin2 = begin;
> + const char *end = begin + strlen (begin) - 1;
> +#ifdef HAVE_DOS_BASED_FILE_SYSTEM
> + /* Skip drive name so 'x:foo' is handled properly. */
> + if (begin2[1] == ':')
> + begin2 += 2;
> +#endif
> + while (end > begin2 && !IS_DIR_SEPARATOR (*end))
> + end--;
Instead of doing this, call lbasename (it's in libiberty).
Otherwise looks fine to me if people think it's the right thing to do.
Ian