[PATCH] D157334: [clang] Define _MSC_EXTENSIONS on -gnu if -fms-extensions is set

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 9 11:59:01 PDT 2023


mstorsjo added a comment.

I think this makes sense in principle - however it does diverge from GCC. GCC also supports `-fms-extensions` (but I'm not sure if the set of extensions that are enabled by the option is an exact match between the two cases), but GCC doesn't expose any extra define in that mode. I don't foresee that it'll cause any concrete harm though...

Which toolchain is the original source for the name `_MSC_EXTENSIONS` - is it something that MSVC itself sets (always, or optionally?), or something that Clang itself has made up?

I tried including this patch in a nightly build run (building llvm-mingw and a handful of projects with it, including VLC as a large testcase), and it didn't trip up anything, so it seems mostly safe in that aspect at least.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157334/new/

https://reviews.llvm.org/D157334



More information about the cfe-commits mailing list