diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-05-29 18:25:42 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-05-29 18:25:42 +0000 |
commit | 4092133f77fa2a29049a6ae4f9a169ce3d3a121a (patch) | |
tree | 5163fc56abe6708a63cf86d3844430681ef8601f /src/include/cctk_WarnLevel.h | |
parent | 92fce89daaf1675228b610921de157f6e57bb7e1 (diff) |
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
Diffstat (limited to 'src/include/cctk_WarnLevel.h')
-rw-r--r-- | src/include/cctk_WarnLevel.h | 19 |
1 files changed, 17 insertions, 2 deletions
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 } |