[PATCH] Fix Windows path formatting when using -MD

Yung, Douglas douglas_yung at playstation.sony.com
Thu Apr 9 15:33:00 PDT 2015


Hi Sean,

The program we are using that consumes the compiler’s –MD output is a tool that we produce which parses the output to provide integration with Visual Studio.

I agree that the example you gave of OpenFile(“\”foo.txt\””) would not be valid, although I’m not sure that the compiler would even generate that on Windows. According to the MSDN documentation (https://msdn.microsoft.com/en-us/library/aa365247), a double quote is not a valid character for a filename, so the compiler should never even reach this point in the code because the compiler would have been unable to resolve the reference to begin with.

Douglas Yung

From: Sean Silva [mailto:chisophugis at gmail.com]
Sent: Thursday, April 09, 2015 14:57
To: Yung, Douglas
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [PATCH] Fix Windows path formatting when using -MD



On Thu, Apr 9, 2015 at 12:27 PM, Yung, Douglas <douglas_yung at playstation.sony.com<mailto:douglas_yung at playstation.sony.com>> wrote:
Hi,

This patch fixes a problem on Windows when the compiler generates a dependency file using –MD or –MMD. The problem is that when emitting a path that contains spaces, the compiler emits it by escaping the spaces with a leading backspace character which is not valid in Windows. The proper fix for this is to just emit the path enclosed in double quotes which is accepted by Windows. This patch makes that change, and the compiler will then generate the double quoted paths only when the compiler is hosted on Windows. It also updates 3 tests that were affected by this change to accept this change on Windows as well as verify the change works as expected.

What program are you using that consumes makefiles and interprets quoted strings? Quoted strings are not part of Makefile syntax. This will result in programs making calls like OpenFile("\"foo.txt\"") which I don't think is valid.

-- Sean Silva


Douglas Yung

_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150409/eeaaf9d3/attachment.html>


More information about the llvm-commits mailing list