diff options
author | bde <bde@FreeBSD.org> | 2003-11-17 02:11:13 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2003-11-17 02:11:13 +0000 |
commit | a2958cef1d957f2573359e38e3935fa2a30a2287 (patch) | |
tree | 074366ef9a503885324b44dcbbeb72f501e976b1 /sys | |
parent | e31c4979ddffdba2acbb92d3c5510f3f710508e2 (diff) | |
download | FreeBSD-src-a2958cef1d957f2573359e38e3935fa2a30a2287.zip FreeBSD-src-a2958cef1d957f2573359e38e3935fa2a30a2287.tar.gz |
Avoid a warning for compiling with `gcc -Wbad-function cast'. (This
is the warning that points to the bug in `(char *)malloc(...)' where
malloc() is implicitly declared as returning int. We do similar things
here, but they work because u_int is the same as uintptr_t on i386's.)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/include/atomic.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index 919bd5a..a54a5ab 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -368,7 +368,11 @@ atomic_cmpset_ptr(volatile void *dst, void *exp, void *src) static __inline void * atomic_load_acq_ptr(volatile void *p) { - return (void *)atomic_load_acq_int((volatile u_int *)p); + /* + * The apparently-bogus cast to intptr_t in the following is to + * avoid a warning from "gcc -Wbad-function-cast". + */ + return ((void *)(intptr_t)atomic_load_acq_int((volatile u_int *)p)); } static __inline void |