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 2/2] Introduce the gcc option --record-gcc-command-line


Hi!

On Thu, Nov 07, 2019 at 06:44:17PM +0100, Egeyar Bagcioglu wrote:
> On 11/7/19 9:03 AM, Segher Boessenkool wrote:
> >>+	ASM_OUTPUT_ASCII(asm_out_file, cmdline, cmdline_length);
> >>+    }
> >>+  cmdline[0] = 0;
> >>+  ASM_OUTPUT_ASCII(asm_out_file, cmdline, 1);
> >>+
> >>+  /* The return value is currently ignored by the caller, but must be 0. 
> >>*/
> >>+  return 0;
> >>+}
> >A temporary file like this isn't so great.
> 
> GCC operates with temporary files, doesn't it? What is the concern that 
> is specific to this one? That is the most reasonable way I found to pass 
> the argv of gcc to child processes for saving. Other ways of passing it 
> that I could think of, or the idea of saving it in the driver were 
> actually very bad ideas.

Oh, this is for passing something to another process?  I guess I didn't
read it closely enough, sorry, never mind.

> >Opening a file as "r" but then
> >accessing it with "fread" is peculiar, too.
> 
> I am not sure what you mean here. Is it that you prefer "wb" and "rb" 
> instead of "w" and "r"? I thought it was enough to use a consistent pair.

I'd use fgets or similar, not fread.


Segher


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