bug-gnulib
[Top][All Lists]
Advanced

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

Re: Fwd: GnuTLS 3.6.12 patch for OS X 10.9


From: Jeffrey Walton
Subject: Re: Fwd: GnuTLS 3.6.12 patch for OS X 10.9
Date: Mon, 3 Feb 2020 18:00:48 -0500

On Mon, Feb 3, 2020 at 4:28 PM Paul Eggert <address@hidden> wrote:
>
> Looking at the online Clang manuals, it appears that Clang started
> supporting _Noreturn starting with 3.5.0. So does the attached
> (untested) patch work for you? If not, please advise.

Thanks Paul.

I think there is a small issue. There are two versions of Clang. First
is Apple Clang distributed with Xcode. Second is LLVM Clang. They use
different version numbers.

In your case, you used LLVM Clang version 3.5. If you look at the
release date (https://releases.llvm.org/), it is September 2014.
Around September 2014 Apple released Xcode 6.0
https://xcodereleases.com/). Apple's versioning of Clang follows
Xcode. So you need to use both:

    * LLVM: version 3.5
    * Apple: version 6.0

To tell the difference between LLVM Clang and Apple Clang, use the
preprocessor macro __apple_build_version__. Apple Clang has
__apple_build_version__, LLVM Clang does not.

So the defines would look something like:

#if defined(__apple_build_version__) && (__clang_major__ >= 6)
    /* _Noreturn works as-is.  */
#elif (__clang_major__ == 3 && __clang_minor__ >= 5) || (__clang_major__ >= 4)
    /* _Noreturn works as-is.  */
# elif ...

Or, you can use __has_attribute(_Noreturn). __has_attribute(_Noreturn)
behaves as expected.

I would not worry about other software using __has_attribute. It is a
reserved symbol due to the leading undersocres. Userland software
should not have been using it in the first place. Software that uses
reserved names wanders off the reservation, and now they have to fix
their mistake.

Jeff



reply via email to

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