summaryrefslogtreecommitdiff
path: root/sds.h
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2009-12-05 13:50:36 +0100
committerantirez <antirez@gmail.com>2009-12-05 13:50:36 +0100
commit682ac7248a11ae7bf0e8d935c3ec13177500484e (patch)
tree9f2f0dfe5036d5160550a7775bbaf0b4d69b6717 /sds.h
parent09f6f7020952cd93e178da11e66e36f8a98398d1 (diff)
downloadredis-682ac7248a11ae7bf0e8d935c3ec13177500484e.tar.gz
use __attribute__ format in sdscatprintf() when the compiler is GCC. Fixed format bugs resulting from the new warnings.
Diffstat (limited to 'sds.h')
-rw-r--r--sds.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sds.h b/sds.h
index 0fc2c9281..0d296ff78 100644
--- a/sds.h
+++ b/sds.h
@@ -52,7 +52,14 @@ sds sdscatlen(sds s, void *t, size_t len);
sds sdscat(sds s, char *t);
sds sdscpylen(sds s, char *t, size_t len);
sds sdscpy(sds s, char *t);
+
+#ifdef __GNUC__
+sds sdscatprintf(sds s, const char *fmt, ...)
+ __attribute__((format(printf, 2, 3)));
+#else
sds sdscatprintf(sds s, const char *fmt, ...);
+#endif
+
sds sdstrim(sds s, const char *cset);
sds sdsrange(sds s, long start, long end);
void sdsupdatelen(sds s);