Enable GNU GCC type checking of format arguments for our functions

This commit is contained in:
Douglas Clowes
2014-02-18 11:27:53 +11:00
parent f7b7c27415
commit 2c25c64db3
4 changed files with 38 additions and 10 deletions

View File

@ -35,7 +35,14 @@ typedef struct {
* \return the new error message list head
*/
void ErrPutMsg(ErrList *list, char *fmt, ...);
#if __GNUC__ > 2
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#else
#define G_GNUC_PRINTF( format_idx, arg_idx )
#endif
void ErrPutMsg(ErrList *list, char *fmt, ...) G_GNUC_PRINTF (2, 3);
#undef G_GNUC_PRINTF
/** \brief Get the most recent error message
* \param list the error list