From f2dab083f6c720df2be1a68b674c49ae643e0396 Mon Sep 17 00:00:00 2001 From: Piotr Tworek Date: Sat, 18 Dec 2021 22:20:29 +0100 Subject: [PATCH] os: Properly initialize File_system::Watch_handle. This comes up when building the code with clang 13. It happens due to recently enabled Wconversion warning, which in case of clang also enables implicit-int-conversion warning. The warning reads: fs_file_system.h:937:44: error: higher order bits are zeroes after implicit conversion [-Werror,-Wimplicit-int-conversion] ::File_system::Watch_handle fs_handle { -1U }; ~~~~~~~~~ ^~~ This can be fixed by properly specifying fs_handle value to be of unsigned long type. Issue #4354 --- repos/os/src/lib/vfs/fs_file_system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/os/src/lib/vfs/fs_file_system.h b/repos/os/src/lib/vfs/fs_file_system.h index 182319f83c..2bd862362b 100644 --- a/repos/os/src/lib/vfs/fs_file_system.h +++ b/repos/os/src/lib/vfs/fs_file_system.h @@ -934,7 +934,7 @@ class Vfs::Fs_file_system : public File_system using namespace ::File_system; Watch_result res = WATCH_ERR_UNACCESSIBLE; - ::File_system::Watch_handle fs_handle { -1U }; + ::File_system::Watch_handle fs_handle { -1UL }; try { fs_handle = _fs.watch(path); } catch (Unavailable) { return WATCH_ERR_UNACCESSIBLE; }