[llvm] r179285 - Add a function to check if an argument list is too long.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sat Apr 13 15:50:44 PDT 2013


> It's still going to be fairly expensive, though.  The maximum command
> line length on Windows is 32K.  On OS X, ARG_MAX appears to be ~10x that
> and (recent) Linux has an ARG_MAX ~10x bigger still.  So using Windows
> as a baseline, and generously assuming that all the files fed to the
> driver are MAX_PATH length characters (260), we'll need a testcase with
> ~250 files.  Doubling or quadrupling that is probably more realistic.
> And even then, depending on the location of the clang source tree, it's
> still not obvious that the test is actually going to be testing what
> it's expected to.
>
> Am I missing something obvious here?  Or is a testcase with 1000 simple
> input files really what should be checked in?

Probably not, but the command line doesn't have to be made of existing
files, so my idea was to use the preprocessor to create a long command
line by just repeating an option (say -LFOOOBAR):

clang -E ... > %t.
clang @%t


> -Nathan

Cheers,
Rafael



More information about the llvm-commits mailing list