From: Alex Rousskov Date: Sun, 13 Mar 2016 04:47:19 +0000 (-0700) Subject: Detect when a child method declaration hides parent's virtual method. X-Git-Tag: SQUID_4_0_8~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=777e83766fee6ae281065b381aef3c857d0cb5ce;p=thirdparty%2Fsquid.git Detect when a child method declaration hides parent's virtual method. Adding -Woverloaded-virtual exposed one problem in the existing code. --- diff --git a/configure.ac b/configure.ac index 16085c6bcf..17579681c5 100644 --- a/configure.ac +++ b/configure.ac @@ -345,7 +345,7 @@ dnl TODO: check if the problem will be present in any other newer MinGW release. SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow" ;; esac - SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow" + SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual" else SQUID_CFLAGS= SQUID_CXXFLAGS= diff --git a/src/clients/FtpRelay.cc b/src/clients/FtpRelay.cc index 4cb3726490..6fb87c0669 100644 --- a/src/clients/FtpRelay.cc +++ b/src/clients/FtpRelay.cc @@ -45,7 +45,7 @@ protected: void serverState(const Ftp::ServerState newState); /* Ftp::Client API */ - virtual void failed(err_type error = ERR_NONE, int xerrno = 0); + virtual void failed(err_type error = ERR_NONE, int xerrno = 0, ErrorState *ftperr = nullptr); virtual void dataChannelConnected(const CommConnectCbParams &io); /* Client API */ @@ -256,7 +256,7 @@ Ftp::Relay::completeForwarding() } void -Ftp::Relay::failed(err_type error, int xerrno) +Ftp::Relay::failed(err_type error, int xerrno, ErrorState *ftpErr) { if (!doneWithServer()) serverState(fssError); @@ -265,7 +265,7 @@ Ftp::Relay::failed(err_type error, int xerrno) if (entry->isEmpty()) failedErrorMessage(error, xerrno); // as a reply - Ftp::Client::failed(error, xerrno); + Ftp::Client::failed(error, xerrno, ftpErr); } void