Le 02/10/2020 à 15:08, Jean-Marc Lasgouttes a écrit :
A few remarks
* there are places with a double space before 'override'
* it does not make sense to keep 'virtual' when overriding.

Could you fix these issues and make the commit message a bit more consistent about why we do that?

On my side, I will add the warning -Wsuggest-override to gcc options.

I just did that and see that many files have now been handled, probably because cppcheck did not warn about Qt headers: GuiView.h, GuiWorkArea.h...

Here is a log file for your enjoyment.

I'll try to handle the boost part by updating our local copy to the latest version 1.74 (which fixes this issue).

A solution to avoid issues with older systems where system boost is not the latest would be to limit the introduction of -Wsuggest-override to gcc 10 and upper (I do gcc 5+ for now). Clang has its own limited version which is on by default.

JMarc
>From deca25db1936b704a1e565df1272df3da223ee01 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Fri, 2 Oct 2020 15:37:32 +0200
Subject: [PATCH] Enable -Wsuggest-override when warnings are on with gcc>=5

This will keep us honest about what virtual methods we override
---
 config/lyxinclude.m4 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index 369ecaefbb..7769728bf6 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -410,11 +410,16 @@ if test x$GXX = xyes; then
   if test x$enable_warnings = xyes ; then
       AM_CPPFLAGS="$AM_CPPFLAGS -Wall -Wextra"
       case $gxx_version in
-	  9.*|10.*|clang-10*)
+	  dnl the weird thing below is because we cannot use directly square braces
+	  @<:@5-8@:>@.*)
+	      AM_CXXFLAGS="$AM_CXXFLAGS -Wsuggest-override";;
+	  9.*|10.*)
+	      AM_CXXFLAGS="$AM_CXXFLAGS -Wsuggest-override -Wno-deprecated-copy";;
+	  clang-10*)
 	      AM_CXXFLAGS="$AM_CXXFLAGS -Wno-deprecated-copy";;
 	  *);;
       esac
-    fi
+  fi
   case $gxx_version in
       2.*|3.*|4.@<:@0-6@:>@) AC_MSG_ERROR([gcc >= 4.7 is required]);;
   esac
-- 
2.25.1

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to