[clang] [clang][Driver] Support -fms-volatile as equivalent to /volatile:ms (PR #74790)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 17:02:42 PST 2023


MaskRay wrote:

Current behavior:
```
% clang --target=x86_64-linux-musl -fms-volatile -c a.cc
clang: warning: argument unused during compilation: '-fms-volatile' [-Wunused-command-line-argument]
% clang --target=x86_64-windows -fms-volatile -c a.cc
clang: warning: argument unused during compilation: '-fms-volatile' [-Wunused-command-line-argument]
```

Shall we make -f[no-]ms-volatile an error for non-Windows targets? (mark it as `TargetSpecific` and only claim it for `isOSWindows()`).
>From https://learn.microsoft.com/en-us/cpp/build/reference/volatile-volatile-keyword-interpretation?view=msvc-170 , I assume that /volatile:ms is a legacy behavior that non-Windows OSes likely don't want to adopt.


https://github.com/llvm/llvm-project/pull/74790


More information about the cfe-commits mailing list