1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

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.)
This commit is contained in:
Bruce Evans 2003-11-17 02:11:13 +00:00
parent 88beb5c906
commit ed9800b4de
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=122826

View File

@ -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