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

Re: Specifying command line arguments in a file?


DJ Delorie <dj@redhat.com> writes:

> The convention is: If an argument begins with '@' and the rest of the
> argument is a valid existing file name, arguments are read from the
> file (ws-delimited) and inserted into the command line.  If the '@'
> isn't followed by a valid existing filename, the argument with the '@'
> is left as-is.

That is a reasonable convention.  One complication is that the gcc
driver wants to look at the file names, so it may need to open
and read the contents of the @file.  The natual thing to do then
is pass the expanded list to the inferior program, which of course
defeats (part of) the purpose.

One solution is for gcc to remember which arguments came from a @file,
and if those same arguments are all to be passed to the inferior
(i.e. no arguments from the @file need to be stripped or re-ordered),
then pass the @file to the inferior.  Otherwise pass the expanded
list of arguments.  Of course this is inefficient, as you're opening
and parsing the @file twice.

Also, whatever we implement, please don't break the @file-parsing
done by the gcj driver.  This means specifically allowing multiple
input files with -o combined with -c or -S, at least for Java.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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