[llvm-bugs] [Bug 39878] New: --help lists -stdlib= as an option on Windows, but it causes “warning: argument unused during compilation”

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 4 08:15:19 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=39878

            Bug ID: 39878
           Summary: --help lists -stdlib= as an option on Windows, but it
                    causes “warning: argument unused during compilation”
           Product: new-bugs
           Version: 7.0
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: flash at pobox.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

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.  Bug 33273 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 at D@std@@SA_KQEBD at 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 at ios_base@std@@QEAAXH_N at 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]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181204/91d8f20a/attachment.html>


More information about the llvm-bugs mailing list