Boost C++ Libraries: Ticket #10849: Dereferencing null pointer in Point<>::dimension_checker::apply() https://svn.boost.org/trac10/ticket/10849 <p> The following lines: </p> <blockquote> <p> P* p = 0; geometry::set&lt;Dimension&gt;(*p, geometry::get&lt;Dimension&gt;(*p)); </p> </blockquote> <p> indicate that the first parameter of the set&lt;&gt;() call will be a null pointer if it is evaluated before the call to get&lt;&gt;(). </p> <p> If this is intentional *and* you can guarantee that the get&lt;&gt;() call will always be made before the first parameter is evaluated, then it should be documented with comments inline. Or, better yet, split the code into 2 lines to insure *p isn't an attempt to dereference a null pointer and to insure that static code checkers don't think it is. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10849 Trac 1.4.3 awulkiew Mon, 15 Dec 2014 23:08:50 GMT <link>https://svn.boost.org/trac10/ticket/10849#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10849#comment:1</guid> <description> <p> Are you asking about the code in the Point concept (<a class="ext-link" href="https://github.com/boostorg/geometry/blob/master/include/boost/geometry/geometries/concepts/point_concept.hpp"><span class="icon">​</span>https://github.com/boostorg/geometry/blob/master/include/boost/geometry/geometries/concepts/point_concept.hpp</a>) ? </p> </description> <category>Ticket</category> </item> </channel> </rss>