CL Command-Line Error D2035

Message Text

response files nested too deeply

Circumstances

Expansion of response files (also called command files) is ordinarily recursive, so that a command-line token in a command file may itself name another command file. Error D2035 can occur only because such nesting has gone too far. The current implementation allows 13 levels.

Demonstration

Let the file “test01.txt” contain just

@test02.txt 

and the file “test02.txt” contain

@test03.txt 

continuing to “test12.txt” containing

@test13.txt 

with “test13.txt” finally naming a source file:

test.cpp 

Then the command

cl /c @test01.txt 

compiles the source file. However, if “test13.txt” instead contains

@test14.txt 

then it doesn’t matter whether a file “test14.txt” even exists: the recursion can go no further and error D2035 is the result.

It seems plausible that error D2035 occurs most often in practice not because command files have intentionally been nested so deeply but instead because the nesting has become circular.

Documentation Status

When describing command-line directives that begin with an @ sign, the product documentation states explicitly that “it is not possible to specify the @ option from within a response file.” This would, of course, mean that error D2035 has no reason to exist. In fact, the error is even documented, which appears to be the product documentation’s only acknowledgement that command files can in fact be nested.