api7 / mod_dubbo

Dubbo module for Nginx
BSD 2-Clause "Simplified" License
6 stars 5 forks source link

gcc compile warning: warning: catching polymorphic type ‘class hessian::io_exception’ by value [-Wcatch-value=] #1

Closed membphis closed 2 years ago

membphis commented 4 years ago
../dubbo-module-2.3.2/ngx_dubbo_util.cpp: In function ‘ngx_int_t ngx_dubbo_hessian2_encode_str(ngx_pool_t*, ngx_str_t*, ngx_str_t*)’:
../dubbo-module-2.3.2/ngx_dubbo_util.cpp:43:27: warning: catching polymorphic type ‘class hessian::io_exception’ by value [-Wcatch-value=]
   43 |     } catch (io_exception e) {
      |                           ^
../dubbo-module-2.3.2/ngx_dubbo_util.cpp: In function ‘ngx_int_t ngx_dubbo_hessian2_encode_map(ngx_pool_t*, ngx_array_t*, ngx_str_t*)’:
../dubbo-module-2.3.2/ngx_dubbo_util.cpp:77:27: warning: catching polymorphic type ‘class hessian::io_exception’ by value [-Wcatch-value=]
   77 |     } catch (io_exception e) {
      |                           ^
../dubbo-module-2.3.2/ngx_dubbo_util.cpp: In function ‘ngx_int_t ngx_dubbo_hessian2_encode_payload_map(ngx_pool_t*, ngx_array_t*, ngx_str_t*)’:
../dubbo-module-2.3.2/ngx_dubbo_util.cpp:119:27: warning: catching polymorphic type ‘class hessian::io_exception’ by value [-Wcatch-value=]
  119 |     } catch (io_exception e) {
      |                           ^
../dubbo-module-2.3.2/ngx_dubbo_util.cpp: In function ‘ngx_int_t ngx_dubbo_hessian2_decode_payload_map(ngx_pool_t*, ngx_str_t*, ngx_array_t**, ngx_log_t*)’:
../dubbo-module-2.3.2/ngx_dubbo_util.cpp:206:27: warning: catching polymorphic type ‘class hessian::io_exception’ by value [-Wcatch-value=]
  206 |     } catch (io_exception e) {
      |                           ^
spacewander commented 2 years ago

Solved in https://github.com/api7/mod_dubbo/commit/81c1c969f7920a3308528a6f578ffa9c4c01e6b7