[PATCH] Fix driver/39293

Richard Guenther richard.guenther@gmail.com
Tue Mar 3 11:42:00 GMT 2009


On Tue, Mar 3, 2009 at 12:47 AM, Ian Lance Taylor <iant@google.com> wrote:
> 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?

Scripts may stop working with the change.  Maybe we don't care, but
I am unsure.  At least this change in behavior would need
documentation in changes.html.

What about adding an alternate -save-temps-o option with the new
semantics?

Richard.

>
>> +           /* 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
>



More information about the Gcc-patches mailing list