[llvm-commits] [cfe-dev] Broken "not" and platform file paths

NAKAMURA Takumi geek4civic at gmail.com
Sun Mar 27 22:47:03 PDT 2011


John,

On Thu, Mar 17, 2011 at 3:40 AM, John Thompson
<john.thompson.jtsoftware at gmail.com> wrote:
> Index: utils/not/not.cpp
> ===================================================================
> --- utils/not/not.cpp (revision 127522)
> +++ utils/not/not.cpp (working copy)
> @@ -15,6 +15,11 @@
>  int main(int argc, const char **argv) {
>    sys::Path Program = sys::Program::FindProgramByName(argv[1]);
>
> +#if defined(_MSC_VER)
> +  if (strstr(Program.c_str(), ".exe") == NULL)
> +    Program.appendSuffix("exe");
> +#endif
> +
>    std::string ErrMsg;
>    int Result = sys::Program::ExecuteAndWait(Program, argv + 1, 0, 0, 0, 0,
>                                              &ErrMsg);

I don't think it would be a right fix.

  - sys::Program::FindProgramByName() should canonicalize a pathname
  - sys::Program::ExecuteAndWait() should accept "x:/path/to/foo"
(without .exe).

Even if this patch were the right fix, I don't understand why this is
MSC-specific. It might be _WIN32 not _MSC_VER.

...Takumi




More information about the llvm-commits mailing list