[Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value
- Next message: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9454: Boost Filesystem not compiling when BOOST_FILESYSTEM_NO_DEPRECATED is defined"
- Previous message: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #10388: null character at end of string from filesystem::temp_directory_path"
- Next in thread: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
#11599: VS2015 warns that in new_tree, not all control paths return a value
-----------------------------------------+---------------------------
Reporter: Edward Brey <edward.brey@â¦> | Owner: cornedbee
Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
Version: Boost 1.59.0 | Severity: Problem
Keywords: warnings |
-----------------------------------------+---------------------------
In standard_callbacks::new_tree, Visual Studio 2015 can't tell from the
assert(false) that the method will never exit after the switch statement,
and so issues this warning:
warning C4715:
'boost::property_tree::json_parser::detail::standard_callbacks<boost::property_tree::basic_ptree<std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> > > >::new_tree': not all control paths return a value
One solution to eliminate the warning and make the code more performant
and, in case of a bug, more repeatable, is to change the end of the method
to use this code:
default:
assert(l.k == leaf);
stack.pop_back();
return new_tree();
}
}
This warning appears for both Debug and Release builds.
--
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11599>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
- Next message: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9454: Boost Filesystem not compiling when BOOST_FILESYSTEM_NO_DEPRECATED is defined"
- Previous message: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #10388: null character at end of string from filesystem::temp_directory_path"
- Next in thread: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11599: VS2015 warns that in new_tree, not all control paths return a value"
This archive was generated by hypermail 2.1.7
: 2017-02-16 18:50:18 UTC