[Openmp-commits] [openmp] a35ad71 - [NFC][OpenMP] Fix const cast warning

Vitaly Buka via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 17 23:25:00 PST 2022


Author: Vitaly Buka
Date: 2022-11-17T23:24:40-08:00
New Revision: a35ad711d90497994701a99723a81badf3d4348e

URL: https://github.com/llvm/llvm-project/commit/a35ad711d90497994701a99723a81badf3d4348e
DIFF: https://github.com/llvm/llvm-project/commit/a35ad711d90497994701a99723a81badf3d4348e.diff

LOG: [NFC][OpenMP] Fix const cast warning

Added: 
    

Modified: 
    openmp/libomptarget/plugins/amdgpu/src/rtl.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
index e00b445695a95..b0e29cb6e4e96 100644
--- a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
+++ b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
@@ -1749,8 +1749,9 @@ struct DeviceEnvironment {
       if (inImage()) {
         DP("Setting global device environment before load (%u bytes)\n",
            SI.Size);
-        uint64_t Offset = (char *)SI.Addr - (char *)Image->ImageStart;
-        void *Pos = (char *)Data + Offset;
+        uint64_t Offset = reinterpret_cast<const char *>(SI.Addr) -
+                          reinterpret_cast<const char *>(Image->ImageStart);
+        void *Pos = reinterpret_cast<char *>(Data) + Offset;
         memcpy(Pos, &HostDeviceEnv, SI.Size);
       }
     }


        


More information about the Openmp-commits mailing list