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

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 8 16:58:28 PDT 2019


rnk added a comment.

In D68055#1698653 <https://reviews.llvm.org/D68055#1698653>, @rsmith wrote:

> 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.


Sounds good.

> 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.

I doubt there's any good reason for it. I'll remove that change from this patch and treat it separately. I think we can simply define it in all modes that enable exceptions.


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