c++visual-studiocompiler-optionsclang-cl

Clang options in VS2019


I am trying the Clang-CL compiler built into VS2019 under Windows 10, but cannot see how to set the compiler options, in particular, long doubles of more than 64-bits.

In the Project settings, the Platform Toolset is LLVM (clang-cl).

Then in C/C++ > All Options > Additional Options I added -mlong-double-80 and compiled, but it gives the message

clang-cl : warning : unknown argument ignored in clang-cl: '-mlong-double-80' [-Wunknown-argument]

It is the same with other options I have tried.

Is there a correct place to add it, or a correct syntax (MSVC seems to prefix with / rather than -)?

Or is there some Clang-CL documentation that says which options work with VS?

I found https://clang.llvm.org/docs/UsersManual.html#id9 but none of the options I tried worked except those that were also MSVC options.


Solution

  • clang-cl is a compatibility layer for MS Visual Studio and offers only the features that are compatible with the vc142 toolset and the Win32 ecosystem, which does not support 80-bit double (source).

    Otherwise "Additional Options" is the correct place to add compiler options.