Open Quuxplusone opened 8 years ago
Bugzilla Link | PR27169 |
Status | NEW |
Importance | P enhancement |
Reported by | Niall Douglas (s_bugzilla@nedprod.com) |
Reported on | 2016-03-31 14:28:08 -0700 |
Last modified on | 2016-04-15 17:21:28 -0700 |
Version | unspecified |
Hardware | All All |
CC | heavenandhell171@gmail.com, llvm-bugs@lists.llvm.org, marci_r@web.de |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also | PR27380 |
> 4. I've noticed that sometimes LLVM clang does not define __clang__ AND
_MSC_VER simultaneously, whereas C1 clang which uses the Microsoft backend does
define both simultaneously. It really would be super useful if you defined both
so code works on both clang's equally, even if some code may break due to bad
macro logic regarding either/or MSVC vs clang.
Sigh. I submitted this bug report when tired. Of course I meant *C2* clang, not
C1 clang throughout the description. I also found a very useful table listing
the macro settings for all of clang variants at
https://blogs.msdn.microsoft.com/vcblog/2015/12/04/clang-with-microsoft-codegen-
in-vs-2015-update-1/, which explains everything about the macro weirdness.
Based on that table I will add a request no. 5 though:
5. Please stop defining __GNUC__ et al when the ABI target is MSVC, even if -
fms-compatibility=no. Only the Microsoft macros _MSC_VER et al should be
defined, and the __clang__ et al ones. Claiming GNU C compatibility makes no
sense whatsoever for a MSVC ABI and MSVCRT targeted build and more importantly,
causes significant breakage for portable C and C++ programs who assume #if
defined(_WIN32) && defined(__GNUC__) means Mingw32 headers and runtime and the
Itanium ABI. As indeed did my code, until last night.
Niall