mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-10 15:45:15 -04:00
patch fixes a -Wstrict-aliasing warning. the patch is needed for LTO,
but fixes a number of warnings output even when not using LTO, hence
applying it for all users
patch taken from 46e60df2d6
Signed-off-by: Ceres <ceres@ceressees.dev>
19 lines
544 B
Diff
19 lines
544 B
Diff
Fixes strict-aliasing error when building with LTO
|
|
From: https://github.com/noctalia-dev/noctalia-qs/commit/46e60df2d6ebb4d52d5bde8a63a9a6255e556097
|
|
|
|
--- a/src/core/model.hpp
|
|
+++ b/src/core/model.hpp
|
|
@@ -170,7 +170,11 @@
|
|
}
|
|
|
|
[[nodiscard]] QList<QObject*> values() override {
|
|
- return *reinterpret_cast<QList<QObject*>*>(&this->mValuesList);
|
|
+ QList<QObject*> result;
|
|
+ result.reserve(this->mValuesList.size());
|
|
+ for (auto* item: this->mValuesList)
|
|
+ result.append(reinterpret_cast<QObject*>(item));
|
|
+ return result;
|
|
}
|
|
|
|
private:
|