On 1/21/21 12:59 PM, Joseph Myers wrote:
On Wed, 20 Jan 2021, Nathan Sidwell wrote:


Unspecified non-existent response file:
OLD:
(1)devvm293:282>g++ -c  @nothing
g++: error: nothing: No such file or directory
g++: fatal error: no input files
compilation terminated.

NEW:
(1)devvm293:284>./xg++ -B./ -c @nothing
xg++: warning: @nothing: linker input file unused because linking not done

This is less clear, in that one might suppose "nothing" is meant to be a
file listing C++ sources to compile, so should be processed and should
result in an error for its absence.  However, this particular place in the
driver handling OPT_SPECIAL_input_file doesn't seem like the right place
for such an error.  Either the correct handling of response files is that
the @file argument is silently kept as-is and so the warning after your
patch is correct, or the correct handling of response files is that there
should be an error if such a file cannot be found (and so users with
filenames starting @ must reference them e.g. as ./@file.cc) and
expandargv should have some way to report that error.  Leaving it to
OPT_SPECIAL_input_file as in the driver at present would mean such an
error doesn't occur when @file, unexpanded, appears to be an option
argument rather than an input file.


Agreed.

I wonder who cares about naming sources '@file.cc' or '@linkerscript' or whatever?

Do you want expandargv altered alongs the lines you mention? Or a bug filed? [in order for my patch to be acceptable]

nathan

--
Nathan Sidwell

Reply via email to