This is an automated email from the ASF dual-hosted git repository.

jerpelea 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 ad9f6b79e0 libs/libcxx: Silence warnings when building libcxx.
ad9f6b79e0 is described below

commit ad9f6b79e060aca53285defdc8a160fa576981bc
Author: Stuart Ianna <stuart.ia...@motec.com.au>
AuthorDate: Thu Oct 26 12:56:55 2023 +1100

    libs/libcxx: Silence warnings when building libcxx.
    
    Silence two warnings when building libcxx with GCC 12.2.0 and std=c++2b:
    
    libcxx/src/charconv.cpp_CXXFLAGS += -Wno-attributes
     - Results from libcxx fallback to use __always_inline__ when 
exclude_from_explicit_instantiation isn't available.
    
    libcxx/src/locale.cpp_CXXFLAGS += -Wno-attributes
     - Results from the expansion of _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS. 
Should be fine to ignore.
---
 libs/libxx/libcxx.defs | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/libs/libxx/libcxx.defs b/libs/libxx/libcxx.defs
index c0c5b51527..9d5922ff93 100644
--- a/libs/libxx/libcxx.defs
+++ b/libs/libxx/libcxx.defs
@@ -115,6 +115,27 @@ endif
 #          ~~~~~~~~~~^~~~~~~~~~~~
 libcxx/src/condition_variable.cpp_CXXFLAGS += -Wno-sign-compare
 
+# When building with GCC 12.2.0
+# libcxx has a fallback to use __always_inline__ when the (clang) 
exclude_from_explicit_instantiation isn't available.
+# This causes: `always_inline` function might not be inlinable [-Wattributes] 
warnings in some modules.
+# For example:
+# libcxx/src/include/to_chars_floating_point.h:988:17: warning: 
‘always_inline’ function might not be inlinable [-Wattributes]
+# Should be OK to ignore these
+ifeq ($(GCCVER),12)
+       libcxx/src/charconv.cpp_CXXFLAGS += -Wno-attributes
+endif
+
+# Another warning on gcc 12.2.0
+# libcxx/src/locale.cpp:6604:85: warning: type attributes ignored after type 
is already defined [-Wattributes]
+# 6604 | template class _LIBCPP_DEPRECATED_IN_CXX20 
_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char, 
mbstate_t>;
+#      |                                                                       
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# libcxx/src/locale.cpp:6605:85: warning: type attributes ignored after type 
is already defined [-Wattributes]
+# 6605 | template class _LIBCPP_DEPRECATED_IN_CXX20 
_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char, 
mbstate_t>;
+ifeq ($(GCCVER),12)
+       libcxx/src/locale.cpp_CXXFLAGS += -Wno-attributes
+endif
+
+
 CPPSRCS += $(wildcard libcxx/src/*.cpp)
 CPPSRCS += $(wildcard libcxx/src/experimental/*.cpp)
 CPPSRCS += $(wildcard libcxx/src/filesystem/*.cpp)

Reply via email to