Remove const specifiers from CyclicDFA members

These const specifiers were ignored by older versions of gcc, likely
because they are in template members that are not instantiated. gcc 14
refuses to compile the class.

Fix by removing the const specifiers. This is safe since these members
are private, so we aren't allowing external users permissions to
modify them.
This commit is contained in:
Avi Kivity 2024-02-05 18:06:10 +02:00
commit e563d7d3f7
2 changed files with 35 additions and 1 deletions

View file

@ -0,0 +1,29 @@
--- a/runtime/Cpp/include/antlr3cyclicdfa.hpp.orig 2024-02-01 14:13:33.243312124 +0200
+++ b/runtime/Cpp/include/antlr3cyclicdfa.hpp 2024-02-01 14:12:28.493542243 +0200
@@ -61,18 +61,18 @@
/// Decision number that a particular static structure
/// represents.
///
+ ANTLR_INT32 m_decisionNumber;
- const ANTLR_INT32 m_decisionNumber;
/// What this decision represents
///
const ANTLR_UCHAR* m_description;
+ const ANTLR_INT32* m_eot;
+ const ANTLR_INT32* m_eof;
+ const ANTLR_INT32* m_min;
+ const ANTLR_INT32* m_max;
+ const ANTLR_INT32* m_accept;
+ const ANTLR_INT32* m_special;
+ const ANTLR_INT32* const * m_transition;
- const ANTLR_INT32* const m_eot;
- const ANTLR_INT32* const m_eof;
- const ANTLR_INT32* const m_min;
- const ANTLR_INT32* const m_max;
- const ANTLR_INT32* const m_accept;
- const ANTLR_INT32* const m_special;
- const ANTLR_INT32* const *const m_transition;
public:
CyclicDFA( ANTLR_INT32 decisionNumber

View file

@ -1,7 +1,7 @@
%global antlr_version 3.5.3
%global c_runtime_version 3.4
%global javascript_runtime_version 3.1
%global baserelease 8
%global baserelease 9
# This package needs itself to build. Use this to bootstrap on a new system.
%bcond_with bootstrap
@ -58,6 +58,8 @@ Patch5: 0005-reproducible-parsers.patch
Patch6: 0006-antlr3memory.hpp-fix-for-C-20-mode.patch
# Compile for target 1.8 to fix build with JDK 11
Patch7: 0007-update-java-target.patch
# Fix source for tighter gcc template checks
Patch8: 0008-unconst-cyclicdfa-gcc-14.patch
BuildRequires: ant
BuildRequires: make
@ -350,6 +352,9 @@ install -pm 644 runtime/Cpp/include/* $RPM_BUILD_ROOT/%{_includedir}/
%doc tool/LICENSE.txt
%changelog
* Thu Feb 1 2024 Avi Kivity <avi@scylladb.com> - 1:3.5.3-9
- Remove const specifiers in templates that are now flagged by gcc 14.
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.5.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild