<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - --help lists -stdlib= as an option on Windows, but it causes “warning: argument unused during compilation”"
href="https://bugs.llvm.org/show_bug.cgi?id=39878">39878</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>--help lists -stdlib= as an option on Windows, but it causes “warning: argument unused during compilation”
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>7.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows XP
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>flash@pobox.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Executing “clang --help” on Windows lists the following:
“-stdlib=<value> C++ standard library to use”
But actually using “-stdlib=” gives a warning about an unused argument; session
below. <a class="bz_bug_link
bz_status_NEW "
title="NEW - support -stdlib=msvc / -stdlib=libc++ when targeting windows"
href="show_bug.cgi?id=33273">Bug 33273</a> suggests that the lack of Windows support is a known issue;
but documenting the option in --help, ignoring it, and then warning about it,
is a poor first-time user experience on Windows. (Not to mention the linker
warnings with Stroustrup’s hello_world.cpp.)
Here’s the session and the version
PS C:\cygwin64\home\flash\Code> clang -stdlib=libc++ -o hello_world.exe
hello_world.cpp
clang.exe: warning: argument unused during compilation: '-stdlib=libc++'
[-Wunused-command-line-argument]
hello_world-a305b1.o : warning LNK4217: locally defined symbol __std_terminate
imported in function "int `public: static unsigned __int64 __cdecl
std::char_traits<char>::length(char const * const)'::`1'::dtor$2"
(?dtor$2@?0??length@?$char_traits@D@std@@SA_KQEBD@Z@4HA)
hello_world-a305b1.o : warning LNK4217: locally defined symbol
_CxxThrowException imported in function "public: void __cdecl
std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QEAAXH_N@Z)
(Similar results with -stdlib=libstdc++ and -stdlib=bogus.)
PS C:\cygwin64\home\flash\Code> clang --version
clang version 7.0.0 (tags/RELEASE_700/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\bin
Installed via LLVM-7.0.0-win64.exe
cmd /c ver
Microsoft Windows [Version 10.0.14393]</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>