aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sds.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sds.h b/src/sds.h
index a46b06b..d0830fe 100644
--- a/src/sds.h
+++ b/src/sds.h
@@ -43,7 +43,9 @@ struct sdshdr {
};
static inline struct sdshdr * sdsheader(const sds s) {
- return s - (sizeof (struct sdshdr));
+ /* The sdshdr pointer has a different alignment than the original char
+ * pointer, so cast it through a void pointer to silence the warning. */
+ return (void *)(s - (sizeof (struct sdshdr)));
}
static inline size_t sdslen(const sds s) {