]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Address cast to pointer from integer of different size in 'libgomp/target.c:gomp_targ...
authorThomas Schwinge <thomas@codesourcery.com>
Tue, 14 Feb 2023 22:34:45 +0000 (23:34 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 14 Feb 2023 22:36:43 +0000 (23:36 +0100)
For example, for '-m32' multilib of x86_64-pc-linux-gnu:

    [...]/libgomp/target.c: In function ‘gomp_target_rev’:
    [...]/libgomp/target.c:3699:33: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     3699 |                                 (void *) devaddrs[i],
          |                                 ^

Fix-up for recent og12 commit 229b705862c1d7f9634f72272b77c22970baf821
"openmp: Add support for the 'present' modifier".

libgomp/
* target.c (gomp_target_rev): Address cast to pointer from integer
of different size.

libgomp/ChangeLog.omp
libgomp/target.c

index 484367d9975044928b3c9fe575ce58213eb21734..67065f5992249e209c8d1d31aff4d7ebddd7cb98 100644 (file)
@@ -1,3 +1,8 @@
+2023-02-14  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * target.c (gomp_target_rev): Address cast to pointer from integer
+       of different size.
+
 2023-02-09  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
        * target.c (gomp_to_device_kind_p): Add map kinds with 'present'
index 426383a451bea3b349baf6591c027efa6940ec55..6edfc9214e4e1309bee7abac2ddd1fc1aa512081 100644 (file)
@@ -3696,12 +3696,12 @@ gomp_target_rev (uint64_t fn_ptr, uint64_t mapnum, uint64_t devaddrs_ptr,
 #ifdef HAVE_INTTYPES_H
                    gomp_fatal ("present clause: no corresponding data on "
                                "parent device at %p with size %"PRIu64,
-                               (void *) devaddrs[i],
+                               (void *) (uintptr_t) devaddrs[i],
                                (uint64_t) sizes[i]);
 #else
                    gomp_fatal ("present clause: no corresponding data on "
                                "parent device at %p with size %lu",
-                               (void *) devaddrs[i],
+                               (void *) (uintptr_t) devaddrs[i],
                                (unsigned long) sizes[i]);
 #endif
                    break;