From: David B. <dbr...@us...> - 2009-10-19 18:49:53
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 783c28ccaa7307ddbfb59425f67d8194636eba98 (commit) from 3c6bb4bce8a3a85495f3297d0e4d2f8a958da662 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 783c28ccaa7307ddbfb59425f67d8194636eba98 Author: Redirect 'Slash' NIL <red...@gm...> Date: Mon Oct 19 09:49:34 2009 -0700 corrective fix for MinGW GNU C99 printf compliance Compilation on cygwin, using gcc v3 with option -mno-cygwin, currently produces a large number of the following warnings: warning: `gnu_printf' is an unrecognized format function type These have been introduced with the recent MinGW GNU C99 printf compliance patch, as gnu_printf was only introduced with gcc v4.4 and is not recognized with earlier versions. The attached fix adds gcc version detection to the previous patch to avoid the problem. diff --git a/src/helper/command.h b/src/helper/command.h index c574efd..ba825bc 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -35,9 +35,10 @@ #include "jim.h" #endif -/* 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 diff --git a/src/helper/log.h b/src/helper/log.h index 8f6ac77..f43e1e6 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 ----------------------------------------------------------------------- Summary of changes: src/helper/command.h | 7 ++++--- src/helper/log.h | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) hooks/post-receive -- Main OpenOCD repository |