X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fhelper%2Flog.h;h=f43e1e6cb0ba8c8bf3df1fc65c0a549b524a0d42;hb=113679ff59e20530c621051d0aceb1876a49c45d;hp=8f6ac7706d365afd1c01a73e7187d71d5ae02cc9;hpb=73349dc5ac33e904a1311829f2e42d923309e744;p=openocd.git diff --git a/src/helper/log.h b/src/helper/log.h index 8f6ac7706d..f43e1e6cb0 100644 --- a/src/helper/log.h +++ b/src/helper/log.h @@ -28,9 +28,10 @@ #include "command.h" -/* To achieve C99 printf compatibility in MinGW, gnu_printf should */ -/* be used for __attribute__((format( ... ))) */ -#ifdef IS_MINGW +/* To achieve C99 printf compatibility in MinGW, gnu_printf should be + * used for __attribute__((format( ... ))), with GCC v4.4 or later + */ +#if (defined(IS_MINGW) && (((__GNUC__ << 16) + __GNUC_MINOR__) >= 0x00040004)) #define PRINTF_ATTRIBUTE_FORMAT gnu_printf #else #define PRINTF_ATTRIBUTE_FORMAT printf