]> 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>
Sun, 13 Mar 2016 04:47:19 +0000 (21:47 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Sun, 13 Mar 2016 04:47:19 +0000 (21:47 -0700)
Adding -Woverloaded-virtual exposed one problem in the existing code.

configure.ac
src/clients/FtpRelay.cc

index 16085c6bcffe72341d52ad6cdbb3c8e1b6a18958..17579681c5c0874ea4abda3b6f509582a712454c 100644 (file)
@@ -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=
index 4cb3726490b396a1ec6fc488baa6240cece34cae..6fb87c06696fb42fccec6b7cc729231677509b6d 100644 (file)
@@ -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