From: Alex Rousskov Date: Wed, 23 Mar 2016 14:37:23 +0000 (+1300) Subject: Detect when a child method declaration hides parent's virtual method. X-Git-Tag: SQUID_3_5_16~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f90ec11655fa9b3294c9fb8e860ea7bfd9173c54;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 b14c4e8dfb..4dcfd8997f 100644 --- a/configure.ac +++ b/configure.ac @@ -371,7 +371,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 25af57fb32..acd6061064 100644 --- a/src/clients/FtpRelay.cc +++ b/src/clients/FtpRelay.cc @@ -42,7 +42,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 */ @@ -272,7 +272,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); @@ -281,7 +281,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