src/common/common.h: do not use `void *` in arithmetic
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 14 Dec 2020 18:07:40 +0000 (13:07 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 31 Aug 2021 18:55:52 +0000 (14:55 -0400)
This avoids a G++ warning:

> common.h:445:22: warning: pointer of type ‘void *’ used in arithmetic
> [-Wpointer-arith]

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I71bad4b54a0aa3baa806e5c29e060d0047c007f2
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4566
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/common/common.h

index c8b9bb8b163b10629b6c781e154affce3f32a301..5266404c934e9e945a129a08c122ecc6cd4f3889 100644 (file)
@@ -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
This page took 0.025611 seconds and 4 git commands to generate.