bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clang, MSYS2 and MSVC


From: Paul Eggert
Subject: Re: Clang, MSYS2 and MSVC
Date: Sun, 15 Oct 2023 19:15:31 -0700
User-agent: Mozilla Thunderbird

On 2023-10-15 17:01, Jeffrey Walton wrote:

A quick heads up... We caught a bug report because Clang got into a
code path intended for MSVC.
Thanks for the heads-up.

Was this in Gnulib, or in some other code? If in Gnulib, where?


Like with the Apple issue, detect it like so:

     #if defined(__clang__) && defined(__apple_build_version__)
     # define APPLE_CLANG_VERSION (__clang_major__ * 10000 +
__clang_minor__ * 100 + __clang_patchlevel__)
     #elif defined(__clang__) && defined(_MSC_VER)
     # define MSVC_CLANG_VERSION (__clang_major__ * 10000 +
__clang_minor__ * 100 + __clang_patchlevel__)
     #elif defined(__clang__)
     # define LLVM_CLANG_VERSION  (__clang_major__ * 10000 +
__clang_minor__ * 100 + __clang_patchlevel__)
     #endif
The problem we observed with Apple's Clang is that __clang_major__, 
__clang_minor__, and __clang_patchlevel__ didn't match standard Clang. 
Sometimes Apple Clang had a feature that wasn't indicated by those 
macros in standard Clang (or vice versa, I forget which).
Does Microsoft Clang have a similar problem? Can you give an example, or 
point to documentation for it?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]