Created
September 9, 2017 07:30
-
-
Save xiangchu0/83db427de20d29fb2d7dca6e13121994 to your computer and use it in GitHub Desktop.
placement new issues with gcc6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| There seems to be a misunderstanding in the following parts. | |
| src/boost/function/function_template.hpp at line 572 | |
| src/boost/function/function_base.hpp at line 308 | |
| Here are the errors as reported by gcc: | |
| src/boost/function/function_template.hpp:572:11: error: placement new constructing an object of type 'network_boost::algorithm::detail::token_finderF<network::detail::normalize_path_segments(network::string_view)::<lambda(char)> >' and size '8' in a region of type 'char' and size '1' [-Werror=placement-new=] | |
| src/boost/function/function_base.hpp:308:13: error: placement new constructing an object of type 'network_boost::detail::function::functor_manager_common<network_boost::algorithm::detail::token_finderF<network::detail::normalize_path_segments(network::string_view)::<lambda(char)> > >::functor_type {aka network_boost::algorithm::detail::token_finderF<network::detail::normalize_path_segments(network::string_view)::<lambda(char)> >}' and size '8' in a region of type 'char' and size '1' [-Werror=placement-new=] | |
| It's apparently something boost needs to address. Here's what I did to shut the compiler up. | |
| Index: src/boost/function/function_base.hpp | |
| =================================================================== | |
| --- src/boost/function/function_base.hpp (revision 63563) | |
| +++ src/boost/function/function_base.hpp (working copy) | |
| @@ -120,8 +120,8 @@ | |
| bool is_volatile_qualified; | |
| } obj_ref; | |
| - // To relax aliasing constraints | |
| - mutable char data; | |
| + // To relax aliasing constraints (HACK - I'm making data at least as big as the things above to avoid a placement-new error we're getting with gcc6. Not sure if that makes this comment now irrelevant) | |
| + mutable char data[sizeof(bound_memfunc_ptr_t)]; | |
| }; | |
| /** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment