[PATCH] D68055: Add -fgnuc-version= to control __GNUC__ and other GCC macros

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 7 17:32:04 PDT 2019


rsmith added a comment.

>From a big-picture perspective, I would like us to move to treating MS and GNU extensions in the same way (at the cc1 level) to the extent that we can. I think this moves us in that direction.

One comment, though: I'm not convinced that the `__EXCEPTIONS` macro should be controlled by this flag. Many compilers define this when exceptions are available (ARM, IBM, HP, EDG in all modes -- including MSVC-compatible mode, ...) and it's not obvious to me whether it is in fact a GNU extension or has more history than that. (It's also a somewhat-documented <http://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html#the-exceptions-macro> Clang feature independent of GCC compatibility.)

Do you know why we turn that macro off under `MSVCCompat`? If EDG can get away with defining it in MSVC-compatible mode, I would expect that we can too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68055





More information about the cfe-commits mailing list