On Wed, 2 Apr 2025 02:00:39 GMT, David Holmes <dhol...@openjdk.org> wrote:

> > there was already a pragma but due to incorrect restrictions it did not 
> > apply to clang.
> 
> How does the `__GNUC__` check affect clang?? Isn't that just for gcc?

clang has a tendency to like to pretend to be other compilers, it defines 
__GNUC__ in addition to __clang__ and even defines _MSC_VER if you're compiling 
for Windows. This is why it's common in code to see the #ifdef __clang__ be the 
very first ifdef when checking for a compiler; It has to be first, otherwise 
the check wouldn't work. If I had to guess, while clang defines __GNUC__ it 
doesn't define it to the version number like gcc does, which is why the > 5 
check failed in clang's case here

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24357#issuecomment-2771672196

Reply via email to