[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)
Max Winkler via cfe-commits
cfe-commits at lists.llvm.org
Tue May 21 19:33:55 PDT 2024
================
@@ -8065,6 +8069,9 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
CmdArgs.push_back("-fno-wchar");
}
+ if (!types::isCXX(InputType) && Args.hasArg(options::OPT_fms_define_stdc))
+ CmdArgs.push_back("-fms-define-stdc");
----------------
MaxEW707 wrote:
This can be deleted. Since `/Zc:__STDC__` is aliased to `fms-define-stdc` this is already handled in the code above.
`AddClangCLArgs` is intended to handle cl.exe options that are not aliased.
If you want `-fms-define-stdc` to be usable when in CL mode then you can add `CLOption` to the visibility as I mentioned above in `Options.td`.
My preference is to remove this code and just add `CLOption`.
See `Option::accept` inside `Option.cpp` for where aliased args are turned into the argument they alias.
https://github.com/llvm/llvm-project/pull/68690
More information about the cfe-commits
mailing list