From 4092133f77fa2a29049a6ae4f9a169ce3d3a121a Mon Sep 17 00:00:00 2001 From: tradke Date: Wed, 29 May 2002 18:25:42 +0000 Subject: Check consistency of fprintf(3)-style format strings passed to CCTK_VWarn() and CCTK_VInfo() when using GNU C/C++. eg now CCTK_REAL r = 3.14; CCTK_VInfo(CCTK_THORNSTRING, "r=%d", r); will give a gcc warning message, because r doesn't match the %d format. Also added missing prototype for CCTK_ParamWarn(). git-svn-id: http://svn.cactuscode.org/flesh/trunk@2867 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/include/cctk_WarnLevel.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/include/cctk_WarnLevel.h') diff --git a/src/include/cctk_WarnLevel.h b/src/include/cctk_WarnLevel.h index 48fca652..c4347c06 100644 --- a/src/include/cctk_WarnLevel.h +++ b/src/include/cctk_WarnLevel.h @@ -25,10 +25,25 @@ int CCTK_VWarn(int level, int line, const char *file, const char *thorn, - const char *format, ...); + const char *format, ...) +#ifdef __GNUC__ +__attribute__ ((format (printf, 5, 6))) +#endif +; +int CCTK_VParamWarn (const char *thorn, + const char *format, + ...) +#ifdef __GNUC__ +__attribute__ ((format (printf, 2, 3))) +#endif +; int CCTK_ParamWarn(const char *thorn, const char *message); int CCTK_Info(const char *thorn, const char *message); -int CCTK_VInfo(const char *thorn, const char *format, ...); +int CCTK_VInfo(const char *thorn, const char *format, ...) +#ifdef __GNUC__ +__attribute__ ((format (printf, 2, 3))) +#endif +; #ifdef __cplusplus } -- cgit v1.2.3