You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/02/20 11:27:02 UTC
[nuttx] branch master updated: libs/libcxx: Workaround -Wmaybe-uninitialized warning with "GCC 12.2"
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new e29d275ef8 libs/libcxx: Workaround -Wmaybe-uninitialized warning with "GCC 12.2"
e29d275ef8 is described below
commit e29d275ef823f9daa7d6b03b143f05b6dc52b00f
Author: chao an <an...@xiaomi.com>
AuthorDate: Mon Feb 20 18:21:25 2023 +0800
libs/libcxx: Workaround -Wmaybe-uninitialized warning with "GCC 12.2"
Signed-off-by: chao an <an...@xiaomi.com>
---
libs/libxx/libcxx.defs | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/libs/libxx/libcxx.defs b/libs/libxx/libcxx.defs
index 16e9a1cd61..83ae915583 100644
--- a/libs/libxx/libcxx.defs
+++ b/libs/libxx/libcxx.defs
@@ -71,6 +71,21 @@ libcxx/src/locale.cpp_CXXFLAGS += -Wno-shadow
libcxx/src/filesystem/directory_iterator.cpp_CXXFLAGS += -Wno-shadow
libcxx/src/filesystem/operations.cpp_CXXFLAGS += -Wno-shadow
+# Workaround the following warning with "GCC 12.2"
+#
+# ...
+# include/libcxx/string:2156:35: warning: '__temp' may be used uninitialized [-Wmaybe-uninitialized]
+# 2156 | this->__throw_length_error();
+# | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
+# include/libcxx/string:614:1: note: by argument 1 of type 'const std::__1::__basic_string_common<true>*' to 'void std::__1::__basic_string_common<<anonymous> >::__throw_length_error() const [with bool <anonymous> = true]' declared here
+# 614 | __basic_string_common<__b>::__throw_length_error() const
+# | ^~~~~~~~~~~~~~~~~~~~~~~~~~
+# include/libcxx/string:2676:32: note: '__temp' declared here
+# 2676 | const basic_string __temp (__first, __last, __alloc());
+# | ^~~~~~
+
+libcxx/src/filesystem/operations.cpp_CXXFLAGS += -Wno-maybe-uninitialized
+
CPPSRCS += $(notdir $(wildcard libcxx/src/*.cpp))
CPPSRCS += $(notdir $(wildcard libcxx/src/experimental/*.cpp))
CPPSRCS += $(notdir $(wildcard libcxx/src/filesystem/*.cpp))