Boost C++ Libraries: Ticket #12362: Default case handling in exception_ptr missing clue for coverity to treat switch fall-through as intentional https://svn.boost.org/trac10/ticket/12362 <p> This is not fall through but undefined behavior as indicated by the use of BOOST_ASSERT. Adding the fall through comment is incorrect and would be misleading. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12362 Trac 1.4.3 Emil Dotchevski Fri, 29 Jul 2016 23:13:22 GMT status, description changed; resolution set https://svn.boost.org/trac10/ticket/12362#comment:1 https://svn.boost.org/trac10/ticket/12362#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> <li><strong>description</strong> modified (<a href="/trac10/ticket/12362?action=diff&amp;version=1">diff</a>) </li> </ul> Ticket James E. King, III <jim.king@…> Sat, 30 Jul 2016 00:57:56 GMT <link>https://svn.boost.org/trac10/ticket/12362#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12362#comment:2</guid> <description> <p> Is BOOST_ASSERT in every build or it is only in debug builds? </p> <p> If the next line is never reached, there's probably a coverity comment hint to indicate that too like the old /* NOTREACHED */ for lint. </p> <p> If it does not assert in a release build then it falls through and perhaps an exception would be a better choice so that it does not behave differently in debug vs. release? </p> <p> Thanks. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Sat, 30 Jul 2016 02:11:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12362#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12362#comment:3</guid> <description> <p> In release or in debug, reaching that code indicates a logic error (bug). I'm not against tagging it as "NOTREACHED" if that helps silence automatic code analyzers, but "fall through" would mislead the reader that fall through is the intended behavior. It is not; if the default is reached, I have a bug. </p> <p> (Throwing an exception is not a good choice for indicating logic errors.) </p> </description> <category>Ticket</category> </item> <item> <author>James E. King, III <jim.king@…></author> <pubDate>Sat, 30 Jul 2016 03:15:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12362#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12362#comment:4</guid> <description> <p> Given BOOST_ASSERT is supposed to have the same characteristics as assert() that means it only happens in debug mode, and this means in release mode builds that is a fall-through. I find that more often than not Coverity is telling the truth; I could easily have marked this as intentional in a third party but I wanted to raise it. Whatever you decide is fine, it's your code. :) </p> </description> <category>Ticket</category> </item> </channel> </rss>