]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Detect when a child method declaration hides parent's virtual method.
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 23 Mar 2016 14:37:23 +0000 (03:37 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 23 Mar 2016 14:37:23 +0000 (03:37 +1300)
Adding -Woverloaded-virtual exposed one problem in the existing code.

configure.ac
src/clients/FtpRelay.cc

index b14c4e8dfbfbeb1297cce30f2b8724e9a6e74dd6..4dcfd8997f0a13dab8e5a94dcd451e325a4e34da 100644 (file)
@@ -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=
index 25af57fb32dd416338586bd182b526b4a33d32cd..acd6061064c33c833f222a12f4a8d7954a0a1880 100644 (file)
@@ -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