Just use — before the file name.  This comes up in other places with other tools as well.  For example, if a file starts with /U clang-cl will interpret it as an option.  This turns out to be extremely common on Mac since home directories are under/Users<br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 10, 2019 at 2:21 AM Danila Malyutin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It can use both. The is no issue with the slashes however since Windows tools use backwards slashes for paths.<br>
<br>
It's unfortunate that this conflicts with the expected behavior on *nix.<br>
IMHO, ideally it should be opt-in, not opt-out (i.e. the users shouldn't need to use workarounds in default case).<br>
<br>
Danila<br>
<br>
-----Original Message-----<br>
From: llvm-dev [mailto:<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>] On Behalf Of Liam Reimers via llvm-dev<br>
Sent: Thursday, January 10, 2019 02:21<br>
To: David Greene <<a href="mailto:dag@cray.com" target="_blank">dag@cray.com</a>><br>
Cc: <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
Subject: Re: [llvm-dev] [llvm-rc] absolute.test failing<br>
<br>
I believe Windows uses slashes instead of hyphens for command line args.<br>
<br>
Liam<br>
<br>
> On Jan 9, 2019, at 2:03 PM, David Greene via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> <br>
> I've come across a curious and pernicious problem in llvm-rc.<br>
> absolute.test checks that llvm-rc can accept a filename that is an <br>
> absolute path.  And it works just fine.  Until you run it with a file <br>
> that starts with "/c."<br>
> <br>
> These will fail:<br>
> <br>
> llvm-rc /crawl/through/some/path/to/my.rc llvm-rc <br>
> /c/some/path/to/my.rc<br>
> <br>
> The option parser ends up interpreting "/" as an option prefix and <br>
> then the parser matches it to this in tools/llvm-rc/Opts.td:<br>
> <br>
> def CODEPAGE : JoinedOrSeparate<[ "/", "-" ], "C">,<br>
>               HelpText<"Set the codepage used for input strings.">;<br>
> <br>
> The test then fails with:<br>
>  Exactly one input file should be provided.<br>
> <br>
> The same problem happens with files that begin with "/r"<br>
> (/read/the/path/to/my.rc) "/sl" (/slink/along/the/path/to/my.rc) or <br>
> any other path that happens to begin with the same text as an option <br>
> in Opts.td.<br>
> <br>
> This triggered on one of our builders that just happens to build to a <br>
> path that begins with "/c."  Presumably none of the existing Buildbots <br>
> build to paths that cause problems.<br>
> <br>
> It's easy enough to construct a test for this, but I'm not sure how/if <br>
> llvm-rc should be fixed.  I don't know why it accepts both "/" and "-"<br>
> as option prefixes.  As this mostly seems related to Windows (resource <br>
> files), should tests be UNSUPPORTED on every other platform?  Or is <br>
> llvm-rc intended to be a cross-platform way to create resource files?<br>
> If the latter, then it seems like options ought to use the "/" prefix <br>
> on Windows and "-" everywhere else so as not to conflict with path <br>
> specifiers.<br>
> <br>
>                             -David<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi</a><br>
> -2Dbin_mailman_listinfo_llvm-2Ddev&d=DwIGaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r<br>
> =YgdxWMcdqQPlU9EdetI-xI79G7ouw9_Us0dFsZnFQYU&m=6ENmoSXIpoXe1OVAf8bSf39<br>
> a8Sw4vpWeGCin4yUzb5g&s=tnu2WT7tKNeiDhu1mTtVYgIqngEZHT7gyUr8dYxM3Mc&e=<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwIGaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=YgdxWMcdqQPlU9EdetI-xI79G7ouw9_Us0dFsZnFQYU&m=6ENmoSXIpoXe1OVAf8bSf39a8Sw4vpWeGCin4yUzb5g&s=tnu2WT7tKNeiDhu1mTtVYgIqngEZHT7gyUr8dYxM3Mc&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwIGaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=YgdxWMcdqQPlU9EdetI-xI79G7ouw9_Us0dFsZnFQYU&m=6ENmoSXIpoXe1OVAf8bSf39a8Sw4vpWeGCin4yUzb5g&s=tnu2WT7tKNeiDhu1mTtVYgIqngEZHT7gyUr8dYxM3Mc&e=</a><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>