From 4f7a5f74774a8797b66a6968b4af9b766bcbd4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 21 Aug 2025 14:38:48 +0300 Subject: [PATCH] Fix clang-21 -Wuninitialized-const-pointer pfs_get_thread_file_name_locker_v1(): Note that the last parameter is unused. Let us pass it as NULL to avoid the warning. --- include/mysql/psi/mysql_file.h | 18 +++++++++--------- storage/innobase/include/os0file.h | 2 +- storage/perfschema/pfs.cc | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h index 096815ed02d..36d073c32e2 100644 --- a/include/mysql/psi/mysql_file.h +++ b/include/mysql/psi/mysql_file.h @@ -775,7 +775,7 @@ inline_mysql_file_stat( #ifdef HAVE_PSI_FILE_INTERFACE struct PSI_file_locker *locker; PSI_file_locker_state state; - locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_STAT, path, &locker); + locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_STAT, path, NULL); if (psi_likely(locker != NULL)) { PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); @@ -1025,7 +1025,7 @@ inline_mysql_file_create( struct PSI_file_locker *locker; PSI_file_locker_state state; locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_CREATE, filename, - &locker); + NULL); if (psi_likely(locker != NULL)) { PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); @@ -1051,7 +1051,7 @@ inline_mysql_file_create_temp( struct PSI_file_locker *locker; PSI_file_locker_state state; locker= PSI_FILE_CALL(get_thread_file_name_locker) - (&state, key, PSI_FILE_CREATE, NULL, &locker); + (&state, key, PSI_FILE_CREATE, NULL, NULL); if (psi_likely(locker != NULL)) { PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); @@ -1078,7 +1078,7 @@ inline_mysql_file_open( struct PSI_file_locker *locker; PSI_file_locker_state state; locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_OPEN, filename, - &locker); + NULL); if (psi_likely(locker != NULL)) { PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); @@ -1298,7 +1298,7 @@ inline_mysql_file_delete( #ifdef HAVE_PSI_FILE_INTERFACE struct PSI_file_locker *locker; PSI_file_locker_state state; - locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_DELETE, name, &locker); + locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_DELETE, name, NULL); if (psi_likely(locker != NULL)) { PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line); @@ -1324,7 +1324,7 @@ inline_mysql_file_rename( struct PSI_file_locker *locker; PSI_file_locker_state state; locker= PSI_FILE_CALL(get_thread_file_name_locker) - (&state, key, PSI_FILE_RENAME, from, &locker); + (&state, key, PSI_FILE_RENAME, from, NULL); if (psi_likely(locker != NULL)) { PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); @@ -1352,7 +1352,7 @@ inline_mysql_file_create_with_symlink( struct PSI_file_locker *locker; PSI_file_locker_state state; locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_CREATE, filename, - &locker); + NULL); if (psi_likely(locker != NULL)) { PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); @@ -1383,7 +1383,7 @@ inline_mysql_file_delete_with_symlink( struct PSI_file_locker *locker; PSI_file_locker_state state; locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_DELETE, fullname, - &locker); + NULL); if (psi_likely(locker != NULL)) { PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line); @@ -1410,7 +1410,7 @@ inline_mysql_file_rename_with_symlink( struct PSI_file_locker *locker; PSI_file_locker_state state; locker= PSI_FILE_CALL(get_thread_file_name_locker) - (&state, key, PSI_FILE_RENAME, from, &locker); + (&state, key, PSI_FILE_RENAME, from, NULL); if (psi_likely(locker != NULL)) { PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index ab25ba28bd4..fb95cc534bf 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -470,7 +470,7 @@ are used to register file deletion operations*/ src_file, src_line) \ do { \ locker = PSI_FILE_CALL(get_thread_file_name_locker)( \ - state, key, op, name, &locker); \ + state, key, op, name, nullptr); \ if (locker != NULL) { \ PSI_FILE_CALL(start_file_open_wait)( \ locker, src_file, src_line); \ diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 1373f9dd43d..195a646da35 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -3247,7 +3247,7 @@ PSI_file_locker* pfs_get_thread_file_name_locker_v1(PSI_file_locker_state *state, PSI_file_key key, PSI_file_operation op, - const char *name, const void *identity) + const char *name, const void *) { assert(static_cast (op) >= 0); assert(static_cast (op) < array_elements(file_operation_map));