diff mbox series

[v2,2/8] osdep: Ignore 'unguarded-availability-new' warnings on macOS Catalina

Message ID 20220215170106.95848-3-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series buildsys: More fixes to use GCC on macOS | expand

Commit Message

Philippe Mathieu-Daudé Feb. 15, 2022, 5:01 p.m. UTC
When building with GCC on macOS Catalina we get 2254 times:

  include/qemu/osdep.h:780:5: warning: 'pthread_jit_write_protect_np' is only available on macOS 11.0 or newer [-Wunguarded-availability-new]
      pthread_jit_write_protect_np(true);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix by using a stricker toolchain version low range, replacing
MAC_OS_X_VERSION_MAX_ALLOWED by MAC_OS_X_VERSION_MIN_REQUIRED.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/qemu/osdep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Akihiko Odaki Feb. 16, 2022, 2:36 a.m. UTC | #1
On Wed, Feb 16, 2022 at 2:01 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> When building with GCC on macOS Catalina we get 2254 times:
>
>   include/qemu/osdep.h:780:5: warning: 'pthread_jit_write_protect_np' is only available on macOS 11.0 or newer [-Wunguarded-availability-new]
>       pthread_jit_write_protect_np(true);
>       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fix by using a stricker toolchain version low range, replacing
> MAC_OS_X_VERSION_MAX_ALLOWED by MAC_OS_X_VERSION_MIN_REQUIRED.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/qemu/osdep.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index aecd2f66ec..1e7a002339 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -774,7 +774,7 @@ size_t qemu_get_host_physmem(void);
>   * for the current thread.
>   */
>  #if defined(MAC_OS_VERSION_11_0) && \
> -    MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
> +    MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0
>  static inline void qemu_thread_jit_execute(void)
>  {
>      pthread_jit_write_protect_np(true);
> --
> 2.34.1
>

This should be squashed with "[PATCH v2 1/8] osdep: Avoid using
Clang-specific __builtin_available()"; Removing __builtin_available
makes it incompatible with macOS < 11.0, hence this change is needed.
diff mbox series

Patch

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index aecd2f66ec..1e7a002339 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -774,7 +774,7 @@  size_t qemu_get_host_physmem(void);
  * for the current thread.
  */
 #if defined(MAC_OS_VERSION_11_0) && \
-    MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
+    MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0
 static inline void qemu_thread_jit_execute(void)
 {
     pthread_jit_write_protect_np(true);