Avoid a gcc -Wint-to-pointer-cast warning

On 32-bit platforms long long is generally 64-bits.  Sufficiently modern
versions of gcc (13 in my testing) complains when casting a pointer to
an integer of a different width so cast to uintptr_t first to avoid the
warning.

Fixes: c183d164aa Parallel pool import
Signed-off-by: Brooks Davis <brooks.davis@sri.com>
This commit is contained in:
Brooks Davis 2024-05-16 23:16:26 +01:00
parent e675852bc1
commit a947b88f4c
1 changed files with 1 additions and 1 deletions

View File

@ -6827,7 +6827,7 @@ spa_tryimport(nvlist_t *tryconfig)
*/
char *name = kmem_alloc(MAXPATHLEN, KM_SLEEP);
(void) snprintf(name, MAXPATHLEN, "%s-%llx-%s",
TRYIMPORT_NAME, (u_longlong_t)curthread, poolname);
TRYIMPORT_NAME, (u_longlong_t)(uintptr_t)curthread, poolname);
mutex_enter(&spa_namespace_lock);
spa = spa_add(name, tryconfig, NULL);