From de17a2f0faf5edf5876110a5590496152c64c347 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Sun, 17 Mar 2024 16:20:44 +0000 Subject: [PATCH] libexpr: Lessen const bound on Value::listElems() const I do not like this being a requirement, but it is necessary to make the C api work with the least amount of ABI changes. listElems() const returns a constant pointer to N constant pointers of Value. This bound is lessened (within defined behavior) to a constant pointer to N *mutable* pointers of Value. The upstream reasoning behind this is reasonable enough, though I strongly distrust it. It might be better to drop the `const` off of the C ABI instead. Change-Id: I8e750b086c1b8d13972aa748ce8f6139f6bcbadb --- src/libexpr/value.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh index 450216ec0..17a85f1de 100644 --- a/src/libexpr/value.hh +++ b/src/libexpr/value.hh @@ -384,7 +384,7 @@ public: return internalType == tList1 || internalType == tList2 ? smallList : bigList.elems; } - const Value * const * listElems() const + Value * const * listElems() const { return internalType == tList1 || internalType == tList2 ? smallList : bigList.elems; }