From 6a195a1bec42996b93eba02a511541a5615d068c Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Wed, 30 Jun 2021 14:16:02 +0300 Subject: [PATCH] [SWIG] fix compiler warning about unused variable in SWIG (#4419) * Update StringArray.i * Update StringArray_API_extensions.i --- swig/StringArray.i | 2 +- swig/StringArray_API_extensions.i | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/swig/StringArray.i b/swig/StringArray.i index 826a90ba8854..b179b02dff31 100644 --- a/swig/StringArray.i +++ b/swig/StringArray.i @@ -31,7 +31,7 @@ StringArrayHandle StringArrayHandle_create(size_t num_strings, size_t string_size) { try { return new StringArray(num_strings, string_size); - } catch (std::bad_alloc &e) { + } catch (std::bad_alloc &/*e*/) { return nullptr; } } diff --git a/swig/StringArray_API_extensions.i b/swig/StringArray_API_extensions.i index 7ffcfbb57f7e..9985765793e5 100644 --- a/swig/StringArray_API_extensions.i +++ b/swig/StringArray_API_extensions.i @@ -54,7 +54,7 @@ try { strings.reset(new StringArray(eval_counts, string_size)); - } catch (std::bad_alloc &e) { + } catch (std::bad_alloc &/*e*/) { LGBM_SetLastError("Failure to allocate memory."); return nullptr; } @@ -92,7 +92,7 @@ try { strings.reset(new StringArray(num_features, max_feature_name_size)); - } catch (std::bad_alloc &e) { + } catch (std::bad_alloc &/*e*/) { LGBM_SetLastError("Failure to allocate memory."); return nullptr; } @@ -131,7 +131,7 @@ nullptr)); try { strings.reset(new StringArray(num_features, max_feature_name_size)); - } catch (std::bad_alloc &e) { + } catch (std::bad_alloc &/*e*/) { LGBM_SetLastError("Failure to allocate memory."); return nullptr; }