Le 07/11/2023 à 18:03, Richard Kimberly Heck a écrit :
I think these must be safe. They have all been in master for three years.

I had a better idea: let's mute these warnings about future C++ versions, since we limit ourselves to C++14 in 2.3.X anyway.

Does the patch below seem OK?

JMarc
From 8e096528988b93d17f9406c5ff4330e05c540b21 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Wed, 8 Nov 2023 15:55:05 +0100
Subject: [PATCH] Avoid warnings about deprecated features.

At this stage of 2.3.x development, warnings about deprecated features
and C++20 reserved keywords (require) are not interesting anymore.
Indeed, this version of LyX will at best compile in C++14 mode.

Therefore, it is safer to hide these warnings than to try to backport
lots of commits from 2.4 tree.
---
 config/lyxinclude.m4 | 9 ++++++++-
 status.23x           | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index a6ff955c2b..251dad4ab6 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -404,12 +404,19 @@ if test x$GXX = xyes; then
   fi
   dnl Warnings are for preprocessor too
   if test x$enable_warnings = xyes ; then
-      AM_CPPFLAGS="$AM_CPPFLAGS -Wall -Wextra"
+      dnl We enable as many warnings as possible, except those about deprecated
+      dnl declarations, which are not useful anymore so late in 2.3 development.
+      dnl Those deprecation issues are duly fixed in 2.4. Here, they are not that
+      dnl important, since we enforce at most C++14.
+      AM_CPPFLAGS="$AM_CPPFLAGS -Wall -Wextra -Wno-deprecated-declarations"
       dnl Shut off warning -Wdeprecated-copy, which triggers too much
       dnl note that g++ always accepts -Wno-xxx, even when -Wxxx is an error.
       AC_LANG_PUSH(C++)
       AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy],
 	[AM_CXXFLAGS="$AM_CXXFLAGS -Wno-deprecated-copy"], [], [-Werror])
+      dnl We do not care about C++20 issues.
+      AX_CHECK_COMPILE_FLAG([-Wc++20-compat],
+	[AM_CXXFLAGS="$AM_CXXFLAGS -Wno-c++20-compat"], [], [-Werror])
       AC_LANG_POP(C++)
     fi
   case $gxx_version in
diff --git a/status.23x b/status.23x
index 2607d611c0..42f0d53778 100644
--- a/status.23x
+++ b/status.23x
@@ -99,3 +99,5 @@ What's new
 
 - fix warning when configuring with Qt 5.15.1x.
 
+- mute warnings about deprecated functions and compatibility issues
+  with C++20. We limit ourselves to C++14 anyway.
-- 
2.40.1

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

Reply via email to