[rtems commit] posix: fix warnings with mmap from heap/wkspace

Gedare Bloom gedare at rtems.org
Mon Jul 24 19:14:47 UTC 2017


Module:    rtems
Branch:    master
Commit:    c6d897e54489e061b25bdb08583b696421799cc2
Changeset: http://git.rtems.org/rtems/commit/?id=c6d897e54489e061b25bdb08583b696421799cc2

Author:    Gedare Bloom <gedare at rtems.org>
Date:      Mon Jul 24 15:09:52 2017 -0400

posix: fix warnings with mmap from heap/wkspace

Avoid void pointer arithmetic.

Updates #2859.

---

 cpukit/posix/src/shmheap.c    | 2 +-
 cpukit/posix/src/shmwkspace.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/posix/src/shmheap.c b/cpukit/posix/src/shmheap.c
index 47f5b47..b36fc28 100644
--- a/cpukit/posix/src/shmheap.c
+++ b/cpukit/posix/src/shmheap.c
@@ -105,6 +105,6 @@ void * _POSIX_Shm_Object_mmap_from_heap(
     return NULL;
   }
 
-  return &(shm_obj->handle[off]);
+  return (char*)shm_obj->handle + off;
 }
 
diff --git a/cpukit/posix/src/shmwkspace.c b/cpukit/posix/src/shmwkspace.c
index bcef353..cfe4d01 100644
--- a/cpukit/posix/src/shmwkspace.c
+++ b/cpukit/posix/src/shmwkspace.c
@@ -90,6 +90,6 @@ void * _POSIX_Shm_Object_mmap_from_workspace(
     return NULL;
   }
 
-  return &(shm_obj->handle[off]);
+  return (char*)shm_obj->handle + off;
 }
 




More information about the vc mailing list