From 287fde33419f24017e4db2fec2825f95977d7c5a Mon Sep 17 00:00:00 2001 From: CHEN Feng Date: Tue, 12 Mar 2019 00:47:11 +0800 Subject: [PATCH] Fix the '-Wcatch-value' warning under gcc 7.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tiv.cpp:464:45: warning: catching polymorphic type ‘struct cimg_library::CImgIOException’ by value [-Wcatch-value=] --- src/main/cpp/tiv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/cpp/tiv.cpp b/src/main/cpp/tiv.cpp index d63897a..818bbbf 100644 --- a/src/main/cpp/tiv.cpp +++ b/src/main/cpp/tiv.cpp @@ -459,7 +459,7 @@ int main(int argc, char* argv[]) { image.resize((int) (image.width() * scale), (int) (image.height() * scale), -100, -100, 5); } emit_image(image, flags); - } catch(cimg_library::CImgIOException e) { + } catch(cimg_library::CImgIOException & e) { error = 1; std::cerr << "File format is not recognized for '" << file_names[i] << "'" << std::endl; } @@ -489,7 +489,7 @@ int main(int argc, char* argv[]) { unsigned int sl = count * (cw + 2); sb.resize(sl - 2, ' '); sb += " "; - } catch (std::exception e) { + } catch (std::exception & e) { // Probably no image; ignore. } }