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]
Other format: [Raw text]

Re: [PATCH] Fix driver/39293


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


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