diff options
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -2196,6 +2196,32 @@ open_at_file (void) in_at_file = true; } +/* Create a temporary @file name. */ + +static char *make_at_file (void) +{ + static int fileno = 0; + char filename[20]; + const char *base, *ext; + + if (!save_temps_flag) + return make_temp_file (""); + + base = dumpbase; + if (!(base && *base)) + base = dumpdir; + if (!(base && *base)) + base = "a"; + + sprintf (filename, ".args.%d", fileno++); + ext = filename; + + if (base == dumpdir && dumpdir_trailing_dash_added) + ext++; + + return concat (base, ext, NULL); +} + /* Close the temporary @file and add @file to the argument list. */ static void @@ -2211,7 +2237,7 @@ close_at_file (void) return; char **argv = (char **) alloca (sizeof (char *) * (n_args + 1)); - char *temp_file = make_temp_file (""); + char *temp_file = make_at_file (); char *at_argument = concat ("@", temp_file, NULL); FILE *f = fopen (temp_file, "w"); int status; |