From 7b0ae083b7ec7afe8c273195c12d075a3c16d13f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 27 Jan 2015 10:44:40 -0500 Subject: Fix clang's only warning in non-test code, about a cast in the shmexport code. All regression tests pass with both gcc- and clang-built binaries. One clang warning remains in the JSON test code. --- shmexport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shmexport.c') diff --git a/shmexport.c b/shmexport.c index 981a6ec2..1d9549d9 100644 --- a/shmexport.c +++ b/shmexport.c @@ -44,7 +44,7 @@ bool shm_acquire(struct gps_context_t *context) strerror(errno)); return false; } - context->shmexport = (char *)shmat(shmid, 0, 0); + context->shmexport = (void *)shmat(shmid, 0, 0); if ((int)(long)context->shmexport == -1) { gpsd_report(&context->errout, LOG_ERROR, "shmat failed: %s\n", strerror(errno)); context->shmexport = NULL; @@ -83,7 +83,7 @@ void shm_update(struct gps_context_t *context, struct gps_data_t *gpsdata) */ shared->bookend2 = tick; memory_barrier(); - memcpy((void *)(context->shmexport + offsetof(struct shmexport_t, gpsdata)), + memcpy((void *)((char *)context->shmexport + offsetof(struct shmexport_t, gpsdata)), (void *)gpsdata, sizeof(struct gps_data_t)); memory_barrier(); -- cgit v1.2.1