In gcc 13, -Wall turns on -Woverloaded-virtual
---

Notes:
    I think despite being marked virtual, these methods aren't actually
    callable on any derived object because they aren't declared for those
    sublasses.
    
    It seems that all calls to these in methods in derived objects use the
    method name qualified by an explcit classname.
    
    So we can simply fix this warning by removing the 'virtual' specifier.
    
    But someone double-checking my reasoning here is probably a good idea.

 Makefile.am |  2 +-
 proppage.h  | 10 +++++-----
 window.h    |  7 +++----
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b459d16..22ad30c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,7 +22,7 @@ SUBDIRS := @subdirs@ tests
 BASECXXFLAGS = -Werror -Wall -Wpointer-arith -Wcomments \
               -Wcast-align -Wwrite-strings -fno-builtin-sscanf \
               -Wno-attributes
-AM_CXXFLAGS = $(BASECXXFLAGS) -std=gnu++11 ${$(*F)_CXXFLAGS}
+AM_CXXFLAGS = $(BASECXXFLAGS) -Woverloaded-virtual -std=gnu++11 
${$(*F)_CXXFLAGS}
 AM_CFLAGS = $(BASECXXFLAGS) -Wmissing-declarations -Winline \
            -Wstrict-prototypes -Wmissing-prototypes
 AM_YFLAGS = -d
diff --git a/proppage.h b/proppage.h
index 64f822b..9db1a90 100644
--- a/proppage.h
+++ b/proppage.h
@@ -115,11 +115,11 @@ public:
     IsLast = false;
   };
 
-  virtual bool Create (int TemplateID);
-  virtual bool Create (DLGPROC dlgproc, int TemplateID);
-  virtual bool Create (DLGPROC dlgproc,
-                      BOOL (*cmdproc) (HWND h, int id, HWND hwndctl,
-                                       UINT code), int TemplateID);
+  bool Create (int TemplateID);
+  bool Create (DLGPROC dlgproc, int TemplateID);
+  bool Create (DLGPROC dlgproc,
+               BOOL (*cmdproc) (HWND h, int id, HWND hwndctl,
+                                UINT code), int TemplateID);
 
   virtual void OnInit ()
   {
diff --git a/window.h b/window.h
index 1dfb2a9..dcc81c1 100644
--- a/window.h
+++ b/window.h
@@ -82,10 +82,9 @@ public:
   Window ();
   virtual ~ Window ();
 
-  virtual bool Create (Window * Parent = NULL,
-                      DWORD Style =
-                      WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN);
-  
+  bool Create (Window * Parent = NULL,
+               DWORD Style = WS_OVERLAPPEDWINDOW | WS_VISIBLE | 
WS_CLIPCHILDREN);
+
   static void SetAppInstance (HINSTANCE h)
   {
     // This only has to be called once in the entire app, before
-- 
2.43.0

Reply via email to