diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-01-27 10:44:40 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-01-27 10:44:40 -0500 |
commit | 7b0ae083b7ec7afe8c273195c12d075a3c16d13f (patch) | |
tree | 9977223f14c8a361a00eefd4206b8566d20c8e78 | |
parent | 321a9bd00b967dc57706601ae9346526d1df7338 (diff) | |
download | gpsd-7b0ae083b7ec7afe8c273195c12d075a3c16d13f.tar.gz |
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.
-rw-r--r-- | gpsd.h-tail | 2 | ||||
-rw-r--r-- | shmexport.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail index 5a78876a..e7812262 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -278,7 +278,7 @@ struct gps_context_t { #ifdef SHM_EXPORT_ENABLE /* we don't want the compiler to treat writes to shmexport as dead code, * and we don't want them reordered either */ - /*@reldef@*/volatile char *shmexport; + /*@reldef@*/volatile void *shmexport; #endif ssize_t (*serial_write)(struct gps_device_t *, const char *buf, const size_t len); 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(); |