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 2020/12/25 03:57:50 UTC

[incubator-nuttx] 02/05: libcxx: Disable -Wshadow for barrier.cpp

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/incubator-nuttx.git

commit 884882501cb295a887bea52ad0c2f001f2e7fce7
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Fri Oct 23 08:12:47 2020 +0900

    libcxx: Disable -Wshadow for barrier.cpp
    
    This might be specific to gcc or Linux
    as I didn't see it with clang + macOS.
    
    libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
    libcxx/src/barrier.cpp:35:9: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
       35 |         : __expected(__expected)
          |         ^
    libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
       29 |     ptrdiff_t&         __expected;
          |                        ^~~~~~~~~~
    libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
    libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
       44 |     }
          |     ^
    libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
       29 |     ptrdiff_t&         __expected;
          |                        ^~~~~~~~~~
    libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
    libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
       44 |     }
          |     ^
    libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
       29 |     ptrdiff_t&         __expected;
          |                        ^~~~~~~~~~
    CXX:  libcxx/src/new.cpp
    In file included from libcxx/src/new.cpp:19:
    /usr/include/c++/9/cxxabi.h: In member function 'virtual bool __cxxabiv1::__pbase_type_info::__pointer_catch(const __cxxabiv1::__pbase_type_info*, void**, unsigned int) const':
    /usr/include/c++/9/cxxabi.h:308:23: error: 'const class std::type_info' has no member named '__do_catch'
      308 |     return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2);
          |                       ^~~~~~~~~~
---
 libs/libxx/libcxx.defs | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libs/libxx/libcxx.defs b/libs/libxx/libcxx.defs
index 13a8450..9bcd74e 100644
--- a/libs/libxx/libcxx.defs
+++ b/libs/libxx/libcxx.defs
@@ -46,6 +46,17 @@ distclean::
 CXXFLAGS += ${shell $(DEFINE) "$(CC)" __GLIBCXX__}
 CXXFLAGS += ${shell $(DEFINE) "$(CC)" _LIBCPP_BUILDING_LIBRARY}
 
+# Workaround the following warning with "c++ (Ubuntu 9.3.0-10ubuntu2) 9.3.0"
+#
+# libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
+# libcxx/src/barrier.cpp:35:9: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
+#    35 |         : __expected(__expected)
+#       |         ^
+# libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
+#    29 |     ptrdiff_t&         __expected;
+#       |                        ^~~~~~~~~~
+libcxx/src/barrier.cpp_CXXFLAGS += -Wno-shadow
+
 CPPSRCS += $(notdir $(wildcard libcxx/src/*.cpp))
 CPPSRCS += $(notdir $(wildcard libcxx/src/experimental/*.cpp))
 CPPSRCS += $(notdir $(wildcard libcxx/src/filesystem/*.cpp))