From 5a8810d2f355e27381bebb9fcb6e1e254828dfdf Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 14 Dec 2020 13:07:40 -0500 Subject: [PATCH] src/common/common.h: do not use `void *` in arithmetic MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This avoids a G++ warning: > common.h:445:22: warning: pointer of type ‘void *’ used in arithmetic > [-Wpointer-arith] Signed-off-by: Philippe Proulx Change-Id: I71bad4b54a0aa3baa806e5c29e060d0047c007f2 Reviewed-on: https://review.lttng.org/c/babeltrace/+/4566 Reviewed-by: Simon Marchi --- src/common/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/common.h b/src/common/common.h index c8b9bb8b..5266404c 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -442,7 +442,7 @@ ssize_t bt_common_read(int fd, void *buf, size_t count, int log_level) BT_ASSERT_DBG(count <= SSIZE_MAX); do { - ret = read(fd, buf + i, count - i); + ret = read(fd, ((char *) buf) + i, count - i); if (ret < 0) { if (errno == EINTR) { #ifdef BT_LOG_WRITE_CUR_LVL -- 2.34.1