This is an automated email from Gerrit. "Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7571
-- gerrit commit ebf7dda8c66b88400c4fa4d70267988246965e20 Author: Antonio Borneo <borneo.anto...@gmail.com> Date: Sun Apr 2 14:24:23 2023 +0200 helper/compiler fix build with gcc on MacOS On MacOS libc includes files from MacOSX.sdk that define the macro #define __nonnull without arguments, causing compile error. Extend the existing check for clang on MacOS and undefine the macro for gcc too. Change-Id: Ic99de78348c6aa86561212a3aded9342e5d32e02 Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com> Reported-by: Erhan Kurubas <erhan.kuru...@espressif.com> diff --git a/src/helper/compiler.h b/src/helper/compiler.h index 33a075d64f..312d261fc3 100644 --- a/src/helper/compiler.h +++ b/src/helper/compiler.h @@ -36,9 +36,11 @@ * clang for Apple defines * #define __nonnull _Nonnull * that is a per argument attribute, incompatible with the gcc per function attribute __nonnull__. - * Undefine it to keep compatibility among compilers. + * gcc for Apple includes sys/cdefs.h from MacOSX.sdk that defines + * #define __nonnull + * In both cases, undefine __nonnull to keep compatibility among compilers and platforms. */ -#if defined(__clang__) && defined(__APPLE__) +#if defined(__APPLE__) # undef __nonnull #endif #ifndef __nonnull --