diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2024-09-14 13:33:09 +0200 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2024-09-28 11:48:24 +0200 |
| commit | ca0626f2f34caa27f3457418b1a694fc684705f5 (patch) | |
| tree | 594d5b7faec293c01747b0b8bba9dfb7699b4eca | |
| parent | a9aee8de59cd8992947417704a0e7d86c13d221a (diff) | |
security/olm: fix build with clang 19
Clang 19 has become more strict about assigning to const variables,
resulting in an error similar to:
/wrkdirs/usr/ports/security/olm/work/olm-6d767aaf29bdf15571c2ef4d3f8f9e953de03733/include/olm/list.hh:106:13: error: cannot assign to variable 'other_pos' with const-qualified type 'T *const'
106 | ++other_pos;
| ^ ~~~~~~~~~
/wrkdirs/usr/ports/security/olm/work/olm-6d767aaf29bdf15571c2ef4d3f8f9e953de03733/include/olm/list.hh:102:19: note: variable 'other_pos' declared const here
102 | T * const other_pos = other._data;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In this case, it looks like a typo: "T * const" means that the pointer
itself is const, thus it cannot be incremented. Instead, this should be
"T const *" (spelled alternatively as "const T *"), which means that the
object pointed to is const, not the pointer itself.
PR: 281496
Approved by: maintainer timeout (2 weeks)
MFH: 2024Q3
(cherry picked from commit c42de78032ea24d6431412e2aec35383c3c66a34)
| -rw-r--r-- | security/olm/files/patch-include_olm_list.hh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/security/olm/files/patch-include_olm_list.hh b/security/olm/files/patch-include_olm_list.hh new file mode 100644 index 000000000000..055f0833a4bc --- /dev/null +++ b/security/olm/files/patch-include_olm_list.hh @@ -0,0 +1,11 @@ +--- include/olm/list.hh.orig 2022-10-07 15:00:05 UTC ++++ include/olm/list.hh +@@ -99,7 +99,7 @@ class List { (public) + return *this; + } + T * this_pos = _data; +- T * const other_pos = other._data; ++ T const * other_pos = other._data; + while (other_pos != other._end) { + *this_pos = *other; + ++this_pos; |
