From 7aba4517f8bba97cf47a88304a596dbd09e35e67 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 13 Jun 2022 15:09:58 +0300 Subject: [PATCH 1/2] ls_mysql.c: Fix cast alignment change warning Compiling with clang gave: ls_mysql.c:342:13: error: cast from 'char *' to 'int *' increases required alignment from 1 to 4 [-Werror,-Wcast-align] Signed-off-by: Marko Lindqvist --- src/ls_mysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ls_mysql.c b/src/ls_mysql.c index f6e2438..f4d3908 100644 --- a/src/ls_mysql.c +++ b/src/ls_mysql.c @@ -339,7 +339,7 @@ static int cur_close (lua_State *L) { ** a reference to it on the cursor structure. */ static void _pushtable (lua_State *L, cur_data *cur, size_t off) { - int *ref = (int *)((char *)cur + off); + int *ref = (int *)cur + off / sizeof(int); /* If colnames or coltypes do not exist, create both. */ if (*ref == LUA_NOREF) -- 2.35.1