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

@ -91,7 +91,14 @@ void SCSignalFunction(void *pCon, int iSignal, void *pSigData);
/* ***************************** I/O ************************************** */
void SCSetOutputClass(SConnection * self, int iClass);
int SCWrite(SConnection * self, char *pBuffer, int iOut);
int SCPrintf(SConnection * self, int iOut, 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
int SCPrintf(SConnection * self, int iOut, char *fmt, ...) G_GNUC_PRINTF (3, 4);
#undef G_GNUC_PRINTF
int SCRead(SConnection * self, char *pBuffer, int iBufLen);
int SCPrompt(SConnection * pCon, char *pPrompt, char *pResult, int iLen);
int SCSendOK(SConnection * self);