← Back to team overview

kicad-developers team mailing list archive

[PATCH 16/16] Clean up warnings from exception handlers

 

The exception objects caught are either not referenced at all, or only in
debug builds. This avoids the warnings for the unused variables.
---
 eeschema/class_libentry.cpp            | 2 +-
 eeschema/class_library.cpp             | 4 ++--
 eeschema/cross-probing.cpp             | 2 +-
 eeschema/dialogs/dialog_bom.cpp        | 2 +-
 eeschema/eeschema_config.cpp           | 6 +++---
 eeschema/lib_export.cpp                | 2 +-
 eeschema/project_rescue.cpp            | 4 ++--
 eeschema/schframe.cpp                  | 2 +-
 eeschema/symbedit.cpp                  | 2 +-
 pcb_calculator/datafile_read_write.cpp | 2 +-
 pcbnew/class_module.cpp                | 2 +-
 pcbnew/dialogs/wizard_add_fplib.cpp    | 2 +-
 pcbnew/moduleframe.cpp                 | 8 ++++----
 utils/idftools/idf_parser.cpp          | 8 ++++----
 14 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp
index eba64bd..31a629a 100644
--- a/eeschema/class_libentry.cpp
+++ b/eeschema/class_libentry.cpp
@@ -141,7 +141,7 @@ bool LIB_ALIAS::SaveDoc( OUTPUTFORMATTER& aFormatter )
 
         aFormatter.Print( 0, "$ENDCMP\n" );
     }
-    catch( const IO_ERROR& ioe )
+    catch( const IO_ERROR& )
     {
         return false;
     }
diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp
index 31372db..b48c004 100644
--- a/eeschema/class_library.cpp
+++ b/eeschema/class_library.cpp
@@ -740,7 +740,7 @@ bool PART_LIB::Save( OUTPUTFORMATTER& aFormatter )
 
         aFormatter.Print( 0, "#\n#End Library\n" );
     }
-    catch( const IO_ERROR& ioe )
+    catch( const IO_ERROR& )
     {
         success = false;
     }
@@ -765,7 +765,7 @@ bool PART_LIB::SaveDocs( OUTPUTFORMATTER& aFormatter )
 
         aFormatter.Print( 0, "#\n#End Doc Library\n" );
     }
-    catch( const IO_ERROR& ioe )
+    catch( const IO_ERROR& )
     {
         success = false;
     }
diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp
index 9c8a160..fd20144 100644
--- a/eeschema/cross-probing.cpp
+++ b/eeschema/cross-probing.cpp
@@ -210,7 +210,7 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
         {
             backAnnotateFootprints( payload );
         }
-        catch( const IO_ERROR& ioe )
+        catch( const IO_ERROR& DBG( ioe ) )
         {
             DBG( printf( "%s: ioe:%s\n", __func__, TO_UTF8( ioe.errorText ) );)
         }
diff --git a/eeschema/dialogs/dialog_bom.cpp b/eeschema/dialogs/dialog_bom.cpp
index 41bd13a..7cfc2f7 100644
--- a/eeschema/dialogs/dialog_bom.cpp
+++ b/eeschema/dialogs/dialog_bom.cpp
@@ -298,7 +298,7 @@ void DIALOG_BOM::installPluginsList()
         {
             cfg_parser.Parse();
         }
-        catch( const IO_ERROR& ioe )
+        catch( const IO_ERROR& )
         {
 //            wxLogMessage( ioe.errorText );
         }
diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp
index 89a72d8..db1c398 100644
--- a/eeschema/eeschema_config.cpp
+++ b/eeschema/eeschema_config.cpp
@@ -138,7 +138,7 @@ void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
     {
         PART_LIBS::LibNamesAndPaths( prj, false, &lib_paths, &lib_names );
     }
-    catch( const IO_ERROR& ioe )
+    catch( const IO_ERROR& DBG( ioe ) )
     {
         DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.errorText ) );)
         return;
@@ -198,7 +198,7 @@ void SCH_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
     {
         PART_LIBS::LibNamesAndPaths( prj, false, &lib_paths, &lib_names );
     }
-    catch( const IO_ERROR& ioe )
+    catch( const IO_ERROR& DBG( ioe ) )
     {
         DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.errorText ) );)
         return;
@@ -665,7 +665,7 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
         {
             m_TemplateFieldNames.Parse( &lexer );
         }
-        catch( const IO_ERROR& e )
+        catch( const IO_ERROR& DBG( e ) )
         {
             // @todo show error msg
             DBG( printf( "templatefieldnames parsing error: '%s'\n",
diff --git a/eeschema/lib_export.cpp b/eeschema/lib_export.cpp
index d4d5c1d..5f58cc2 100644
--- a/eeschema/lib_export.cpp
+++ b/eeschema/lib_export.cpp
@@ -66,7 +66,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
         std::auto_ptr<PART_LIB> new_lib( PART_LIB::LoadLibrary( fn.GetFullPath() ) );
         lib = new_lib;
     }
-    catch( const IO_ERROR& ioe )
+    catch( const IO_ERROR& )
     {
         wxString msg = wxString::Format( _(
             "Unable to import library '%s'.  Error:\n"
diff --git a/eeschema/project_rescue.cpp b/eeschema/project_rescue.cpp
index f1fdd4e..86b1be0 100644
--- a/eeschema/project_rescue.cpp
+++ b/eeschema/project_rescue.cpp
@@ -132,12 +132,12 @@ static bool insert_library( PROJECT *aProject, PART_LIB *aLibrary, size_t aIndex
     {
         libs->LoadAllLibraries( aProject );
     }
-    catch( const PARSE_ERROR& e )
+    catch( const PARSE_ERROR& )
     {
         // Some libraries were not found. There's no point in showing the error,
         // because it was already shown. Just don't do anything.
     }
-    catch( const IO_ERROR& e )
+    catch( const IO_ERROR& )
     {
         // Restore the old list
         libs->clear();
diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp
index ecdc7fd..e6e6ca2 100644
--- a/eeschema/schframe.cpp
+++ b/eeschema/schframe.cpp
@@ -114,7 +114,7 @@ SEARCH_STACK* PROJECT::SchSearchS()
         {
             PART_LIBS::LibNamesAndPaths( this, false, &libDir );
         }
-        catch( const IO_ERROR& ioe )
+        catch( const IO_ERROR& DBG( ioe ) )
         {
             DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.errorText ) );)
         }
diff --git a/eeschema/symbedit.cpp b/eeschema/symbedit.cpp
index fd5b4eb..f582fe5 100644
--- a/eeschema/symbedit.cpp
+++ b/eeschema/symbedit.cpp
@@ -235,7 +235,7 @@ void LIB_EDIT_FRAME::SaveOneSymbol()
             formatter.Print( 0, "ENDDRAW\n" );
             formatter.Print( 0, "ENDDEF\n" );
         }
-        catch( const IO_ERROR& ioe )
+        catch( const IO_ERROR& )
         {
             msg.Printf( _( "An error occurred attempting to save symbol file '%s'" ),
                         GetChars( fn.GetFullPath() ) );
diff --git a/pcb_calculator/datafile_read_write.cpp b/pcb_calculator/datafile_read_write.cpp
index a058a2a..82596b2 100644
--- a/pcb_calculator/datafile_read_write.cpp
+++ b/pcb_calculator/datafile_read_write.cpp
@@ -103,7 +103,7 @@ bool PCB_CALCULATOR_FRAME::WriteDataFile()
         while( nestlevel-- )
             formatter.Print( nestlevel, ")\n" );
     }
-    catch( const IO_ERROR& ioe )
+    catch( const IO_ERROR& )
     {
         return false;
     }
diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp
index fef9924..3ef758b 100644
--- a/pcbnew/class_module.cpp
+++ b/pcbnew/class_module.cpp
@@ -866,7 +866,7 @@ void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
         aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
         aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
     }
-    catch( boost::bad_function_call& e )
+    catch( boost::bad_function_call& )
     {
         DisplayError( NULL, wxT( "Error running MODULE::RunOnChildren" ) );
     }
diff --git a/pcbnew/dialogs/wizard_add_fplib.cpp b/pcbnew/dialogs/wizard_add_fplib.cpp
index 17fdb9b..a775b4b 100644
--- a/pcbnew/dialogs/wizard_add_fplib.cpp
+++ b/pcbnew/dialogs/wizard_add_fplib.cpp
@@ -177,7 +177,7 @@ bool WIZARD_FPLIB_TABLE::LIBRARY::Test()
     {
         footprints = p->FootprintEnumerate( m_path );
     }
-    catch( IO_ERROR& e )
+    catch( IO_ERROR& )
     {
         m_status = LIBRARY::INVALID;
         return false;
diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp
index 4e3f822..1014e07 100644
--- a/pcbnew/moduleframe.cpp
+++ b/pcbnew/moduleframe.cpp
@@ -357,7 +357,7 @@ const wxString FOOTPRINT_EDIT_FRAME::getLibPath()
 
         return row->GetFullURI( true );
     }
-    catch( const IO_ERROR& ioe )
+    catch( const IO_ERROR& )
     {
         return wxEmptyString;
     }
@@ -400,12 +400,12 @@ void FOOTPRINT_EDIT_FRAME::restoreLastFootprint()
         {
             module = (MODULE*) pcb_io.Parse( pretty );
         }
-        catch( const PARSE_ERROR& pe )
+        catch( const PARSE_ERROR& )
         {
             // unlikely to be a problem, since we produced the pretty string.
             wxLogError( wxT( "PARSE_ERROR" ) );
         }
-        catch( const IO_ERROR& ioe )
+        catch( const IO_ERROR& )
         {
             // unlikely to be a problem, since we produced the pretty string.
             wxLogError( wxT( "IO_ERROR" ) );
@@ -767,7 +767,7 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
             if( !writable )
                 title += _( " [Read Only]" );
         }
-        catch( const IO_ERROR& ioe )
+        catch( const IO_ERROR& )
         {
             // user may be bewildered as to why after selecting a library it is not showing up
             // in the title, we could show an error message, but that should have been done at time
diff --git a/utils/idftools/idf_parser.cpp b/utils/idftools/idf_parser.cpp
index 6b3b9d9..5768c30 100644
--- a/utils/idftools/idf_parser.cpp
+++ b/utils/idftools/idf_parser.cpp
@@ -2381,7 +2381,7 @@ void IDF3_BOARD::readBoardFile( const std::string& aFileName, bool aNoSubstitute
             }
         }
     }
-    catch( const std::exception& e )
+    catch( const std::exception& )
     {
         brd.exceptions ( std::ios_base::goodbit );
 
@@ -2699,7 +2699,7 @@ void IDF3_BOARD::readLibFile( const std::string& aFileName )
 
         while( lib.good() ) readLibSection( lib, state, this );
     }
-    catch( const std::exception& e )
+    catch( const std::exception& )
     {
         lib.exceptions ( std::ios_base::goodbit );
 
@@ -2853,7 +2853,7 @@ bool IDF3_BOARD::writeLibFile( const std::string& aFileName )
         }
 
     }
-    catch( const std::exception& e )
+    catch( const std::exception& )
     {
         lib.exceptions( std::ios_base::goodbit );
 
@@ -3120,7 +3120,7 @@ void IDF3_BOARD::writeBoardFile( const std::string& aFileName )
         }
 
     }
-    catch( const std::exception& e )
+    catch( const std::exception& )
     {
         brd.exceptions( std::ios_base::goodbit );
 

Follow ups

References