Revert Coverity fix that caused build issue with older versions of Boost.

The Boost entropy exception does not exist prior to version 1.67. Once
the minimum Boost version is raise to 1.67 or greater, enable catching
the exception.  We will just have to live with the possibility of an
uncaught exception until then.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6804
This commit is contained in:
Wayne Stambaugh 2020-12-21 08:41:05 -05:00
parent c36f3ab521
commit 090d7881e0
1 changed files with 13 additions and 0 deletions

View File

@ -24,7 +24,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/// @todo The Boost entropy exception does not exist prior to 1.67. Once the minimum Boost
/// version is raise to 1.67 or greater, this version check can be removed.
#include <boost/version.hpp>
#if BOOST_VERSION >= 106700
#include <boost/uuid/entropy_error.hpp> #include <boost/uuid/entropy_error.hpp>
#endif
#include <kiface_i.h> #include <kiface_i.h>
#include <confirm.h> #include <confirm.h>
#include <dialog_helpers.h> #include <dialog_helpers.h>
@ -180,6 +187,9 @@ void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem )
BOARD_ITEM* lastItem = nullptr; BOARD_ITEM* lastItem = nullptr;
/// @todo The Boost entropy exception does not exist prior to 1.67. Once the minimum Boost
/// version is raise to 1.67 or greater, this version check can be removed.
#if BOOST_VERSION >= 106700
try try
{ {
lastItem = GetBoard()->GetItem( lastBrightenedItemID ); lastItem = GetBoard()->GetItem( lastBrightenedItemID );
@ -188,6 +198,9 @@ void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem )
{ {
wxLogError( "A Boost UUID entropy exception was thrown in %s:%s.", __FILE__, __FUNCTION__ ); wxLogError( "A Boost UUID entropy exception was thrown in %s:%s.", __FILE__, __FUNCTION__ );
} }
#else
lastItem = GetBoard()->GetItem( lastBrightenedItemID );
#endif
if( lastItem && lastItem != aItem && lastItem != DELETED_BOARD_ITEM::GetInstance() ) if( lastItem && lastItem != aItem && lastItem != DELETED_BOARD_ITEM::GetInstance() )
{ {