This is the mail archive of the 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]

gcc -save-temps deletes .o files in 3.1

I have gcc 3.1 on solaris 2.8.

I expected gcc -save-temps to  leave the objects around.

Looking closer, it works in 2.95 and 3.0.3.

In 3.1, it seems to go through the code (in gcc.c)

 4304       case '\t':
  4305       case ' ':
  4306  /* Space or tab ends an argument if one is pending.  */
- 4307  if (arg_going)
  4308    {
- 4309      obstack_1grow (&obstack, 0);
- 4310      string = obstack_finish (&obstack);
- 4311      if (this_is_library_file)
- 4312        string = find_file (string);
- 4313      store_arg (string, delete_this_arg, this_is_output_file);
- 4314      if (this_is_output_file)
- 4315        outfiles[input_file_number] = string;
  4316    }

/* Add one argument to the vector at the end.
   This is done when a space is seen or at the end of the line.
   If DELETE_ALWAYS is nonzero, the arg is a filename
    and the file should be deleted eventually.
   If DELETE_FAILURE is nonzero, the arg is a filename
    and the file should be deleted if this compilation fails.  */

static void
store_arg (arg, delete_always, delete_failure)
     const char *arg;
     int delete_always, delete_failure;
  if (argbuf_index + 1 == argbuf_length)
      = (const char **) xrealloc (argbuf,
                                  (argbuf_length *= 2) * sizeof (const
char *));

  argbuf[argbuf_index++] = arg;
  argbuf[argbuf_index] = 0;

  if (delete_always || delete_failure)
    record_temp_file (arg, delete_always, delete_failure);

However, in this path the save-temps flag isn't checked

Marty Leisner

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