From f07c6fdebac88acbe4e58175e1fd81791cc5a332 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Tue, 5 Feb 2019 08:26:26 -0800 Subject: [PATCH 1/2] Fix gcc warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: catching polymorphic type ‘class std::bad_alloc’ by value [-Wcatch-value=] --- src/_tkagg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_tkagg.cpp b/src/_tkagg.cpp index 47862838bbda..f80308166ca8 100644 --- a/src/_tkagg.cpp +++ b/src/_tkagg.cpp @@ -118,7 +118,7 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int try { destbuffer = new agg::int8u[deststride * destheight]; } - catch (std::bad_alloc) { + catch (const std::bad_alloc& e) { TCL_APPEND_RESULT(interp, "could not allocate memory", (char *)NULL); return TCL_ERROR; } From f082f0ec97e0a3018f1fde0cfb7d2441568d1a13 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Tue, 5 Feb 2019 08:31:48 -0800 Subject: [PATCH 2/2] Remove unused variable --- src/_tkagg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_tkagg.cpp b/src/_tkagg.cpp index f80308166ca8..9c9623344b84 100644 --- a/src/_tkagg.cpp +++ b/src/_tkagg.cpp @@ -118,7 +118,7 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int try { destbuffer = new agg::int8u[deststride * destheight]; } - catch (const std::bad_alloc& e) { + catch (const std::bad_alloc &) { TCL_APPEND_RESULT(interp, "could not allocate memory", (char *)NULL); return TCL_ERROR; }