You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/29 19:27:32 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #6181: tools/ci: Enable libcxx test config

xiaoxiang781216 commented on PR #6181:
URL: https://github.com/apache/incubator-nuttx/pull/6181#issuecomment-1113651334

   > These boards need either `-std=c++17` or `-faligned-new` to be provided to `CXXFLAGS`.
   > 
   > ```
   > libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
   > Error: libcxx/src/barrier.cpp:37:64: error: 'new' of type 'std::__1::__barrier_algorithm_base::__state_t' with extended alignment 64 [-Werror=aligned-new=]
   >    37 |         __state = unique_ptr<__state_t[]>(new __state_t[__count]);
   >       |                                                                ^
   > libcxx/src/barrier.cpp:37:64: note: uses 'void* operator new [](size_t)', which does not have an alignment parameter
   > libcxx/src/barrier.cpp:37:64: note: use '-faligned-new' to enable C++17 over-aligned new support
   > cc1plus: all warnings being treated as errors
   > make[1]: *** [Makefile:77: barrier.o] Error 1
   > make[1]: Target 'libxx.a' not remade because of errors.
   > make: *** [tools/LibTargets.mk:194: libs/libxx/libxx.a] Error 2
   > make: Target 'all' not remade because of errors.
   > ```
   
   Yes, I am looking how to fix it. I found that:
   
   1. --std=c++11 skip compile barrier.cpp(then no error) because  barrier is defined in c++14
   2. --std=c++14 generate the above warning
   3. --std=c++17 pass the compile without warning
   
   I guess libcxx author forget c++14, which support barrier but not aligned new. barrier.cpp should provide an alternative implementation instead forcing the user upgrade compiler from c++14 to c++17.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org