mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00

Now that oss-fuzz is on a clang commit > the 17.x release candidates, we can start looking at some shiny new features to enable.
98 lines
4.7 KiB
Diff
98 lines
4.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Andrew Kaster <andrewdkaster@gmail.com>
|
|
Date: Sun, 12 Jun 2022 23:13:56 -0600
|
|
Subject: [PATCH] make: Build with c++23 when targeting serenity
|
|
|
|
---
|
|
make/autoconf/flags-cflags.m4 | 8 ++++++--
|
|
src/hotspot/share/utilities/chunkedList.hpp | 2 +-
|
|
src/hotspot/share/utilities/events.hpp | 2 +-
|
|
src/hotspot/share/utilities/growableArray.hpp | 2 +-
|
|
src/hotspot/share/utilities/linkedlist.hpp | 2 +-
|
|
5 files changed, 10 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
|
|
index 88679489fc09019212286e0cb75885a05103dc85..63126c98054760f8a657d6ba7d51d5aeb3eebf18 100644
|
|
--- a/make/autoconf/flags-cflags.m4
|
|
+++ b/make/autoconf/flags-cflags.m4
|
|
@@ -187,7 +187,8 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
|
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
|
|
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
|
|
|
|
- DISABLED_WARNINGS="unused-parameter unused"
|
|
+ DISABLED_WARNINGS="unused-parameter unused address stringop-overflow stringop-truncation format-truncation use-after-free"
|
|
+ DISABLED_WARNINGS_CXX="volatile deprecated-enum-enum-conversion deprecated-enum-float-conversion"
|
|
;;
|
|
|
|
clang)
|
|
@@ -200,7 +201,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
|
-Wunused-function -Wundef -Wunused-value -Woverloaded-virtual"
|
|
WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
|
|
|
|
- DISABLED_WARNINGS="unknown-warning-option unused-parameter unused"
|
|
+ DISABLED_WARNINGS="unknown-warning-option unused-parameter unused deprecated-volatile deprecated-anon-enum-enum-conversion deprecated-enum-float-conversion ambiguous-reversed-operator"
|
|
|
|
;;
|
|
|
|
@@ -565,6 +566,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
|
else
|
|
AC_MSG_ERROR([Don't know how to enable C++14 for this toolchain])
|
|
fi
|
|
+ if test "x$OPENJDK_TARGET_OS" = xserenity; then
|
|
+ LANGSTD_CXXFLAGS="-std=c++23"
|
|
+ fi
|
|
TOOLCHAIN_CFLAGS_JDK_CXXONLY="$TOOLCHAIN_CFLAGS_JDK_CXXONLY $LANGSTD_CXXFLAGS"
|
|
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM $LANGSTD_CXXFLAGS"
|
|
ADLC_LANGSTD_CXXFLAGS="$LANGSTD_CXXFLAGS"
|
|
diff --git a/src/hotspot/share/utilities/chunkedList.hpp b/src/hotspot/share/utilities/chunkedList.hpp
|
|
index 1a899ee2bfb2e8ef20bb98914fe909248f1aec45..13f05cd3a85acde45124b5cda6303f5198eecb9c 100644
|
|
--- a/src/hotspot/share/utilities/chunkedList.hpp
|
|
+++ b/src/hotspot/share/utilities/chunkedList.hpp
|
|
@@ -44,7 +44,7 @@ template <class T, MEMFLAGS F> class ChunkedList : public CHeapObj<F> {
|
|
}
|
|
|
|
public:
|
|
- ChunkedList<T, F>() : _top(_values), _next_used(NULL), _next_free(NULL) {}
|
|
+ ChunkedList() : _top(_values), _next_used(NULL), _next_free(NULL) {}
|
|
|
|
bool is_full() const {
|
|
return _top == end();
|
|
diff --git a/src/hotspot/share/utilities/events.hpp b/src/hotspot/share/utilities/events.hpp
|
|
index 6f3dadde281c04910d9704de6313276cb74dcd4a..945295deab81fbf75343ea361627c435b2094247 100644
|
|
--- a/src/hotspot/share/utilities/events.hpp
|
|
+++ b/src/hotspot/share/utilities/events.hpp
|
|
@@ -99,7 +99,7 @@ template <class T> class EventLogBase : public EventLog {
|
|
EventRecord<T>* _records;
|
|
|
|
public:
|
|
- EventLogBase<T>(const char* name, const char* handle, int length = LogEventsBufferEntries):
|
|
+ EventLogBase(const char* name, const char* handle, int length = LogEventsBufferEntries):
|
|
_mutex(Mutex::event, name, true, Mutex::_safepoint_check_never),
|
|
_name(name),
|
|
_handle(handle),
|
|
diff --git a/src/hotspot/share/utilities/growableArray.hpp b/src/hotspot/share/utilities/growableArray.hpp
|
|
index b75283843eb798e476ffd15d2b8d7a06c8c41586..67074b86fe231fcf3efc93e0bef04c792e2f62c1 100644
|
|
--- a/src/hotspot/share/utilities/growableArray.hpp
|
|
+++ b/src/hotspot/share/utilities/growableArray.hpp
|
|
@@ -118,7 +118,7 @@ class GrowableArrayView : public GrowableArrayBase {
|
|
protected:
|
|
E* _data; // data array
|
|
|
|
- GrowableArrayView<E>(E* data, int initial_max, int initial_len) :
|
|
+ GrowableArrayView(E* data, int initial_max, int initial_len) :
|
|
GrowableArrayBase(initial_max, initial_len), _data(data) {}
|
|
|
|
~GrowableArrayView() {}
|
|
diff --git a/src/hotspot/share/utilities/linkedlist.hpp b/src/hotspot/share/utilities/linkedlist.hpp
|
|
index 16ee6a844fa1afb1cdbc8f3f0656c59710ac4e5e..2c5ffe6cb48085791598252c40b9c526a8b9ac97 100644
|
|
--- a/src/hotspot/share/utilities/linkedlist.hpp
|
|
+++ b/src/hotspot/share/utilities/linkedlist.hpp
|
|
@@ -82,7 +82,7 @@ template <class E> class LinkedListNode : public ResourceObj {
|
|
template <class E> class LinkedList : public ResourceObj {
|
|
protected:
|
|
LinkedListNode<E>* _head;
|
|
- NONCOPYABLE(LinkedList<E>);
|
|
+ NONCOPYABLE(LinkedList);
|
|
|
|
public:
|
|
LinkedList() : _head(NULL) { }
|