From d37d75dfeb7d5aeedf8ba781c248e27d14c0b450 Mon Sep 17 00:00:00 2001 From: Alex Biddulph Date: Fri, 19 Aug 2022 10:11:39 +1000 Subject: [PATCH] Default initialise is_handle_internal_ gcc12 flags `is_handle_internal_` as maybe being uninitialised. This PR adds a default initialisation for `is_handle_internal_` to avoid this. ``` /usr/local/include/mio/detail/mmap.ipp:419:8: warning: '.mio::basic_mmap::is_handle_internal_' may be used uninitialized [-Wmaybe-uninitialized] 419 | if(is_handle_internal_) | ^~~~~~~~~~~~~~~~~~~ ``` --- include/mio/mmap.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mio/mmap.hpp b/include/mio/mmap.hpp index def559a..40f2981 100644 --- a/include/mio/mmap.hpp +++ b/include/mio/mmap.hpp @@ -97,7 +97,7 @@ struct basic_mmap // user provided it, but we must close it if we obtained it using the // provided path. For this reason, this flag is used to determine when to // close `file_handle_`. - bool is_handle_internal_; + bool is_handle_internal_{false}; public: /**