rocr/amd_core_dump: Fix "arithmetic on a pointer to void"
A recent patch introduced a build failure when building with Clang:
[ 65%] Building CXX object runtime/hsa-runtime/CMakeFiles/hsa-runtime64.dir/libamdhsacode/amd_core_dump.cpp.o
[…]/runtime/hsa-runtime/libamdhsacode/amd_core_dump.cpp:271:29: error: arithmetic on a pointer to void
271 | read = pread(fd_, buf + done, buf_size - done,
| ~~~ ^
1 error generated.
This patch fixes this by making sure the "void *" pointer is converting
to "char *" before doing arithmetic on it.
Change-Id: Ib1663ed30abce76e05f06d042975eccd7d729823
This commit is contained in:
committed by
David Yat Sin
parent
eb30a5bbc7
commit
3475a45137
@@ -268,7 +268,8 @@ struct LoadSegmentBuilder : public SegmentBuilder {
|
||||
size_t done = 0;
|
||||
ssize_t read;
|
||||
do {
|
||||
read = pread(fd_, buf + done, buf_size - done, offset + done);
|
||||
read = pread(fd_, static_cast<char *>(buf) + done, buf_size - done,
|
||||
offset + done);
|
||||
|
||||
if (read == -1 && errno != EINTR) {
|
||||
perror("Failed to read GPU memory");
|
||||
|
||||
Reference in New Issue
Block a user