Bug 281496 - devel/olm: fix build with clang 19
Summary: devel/olm: fix build with clang 19
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-14 11:32 UTC by Dimitry Andric
Modified: 2024-09-28 09:49 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-09-14 11:32:39 UTC
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.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-09-14 11:35:50 UTC
Oops, wrong category.
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-09-28 09:48:16 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c42de78032ea24d6431412e2aec35383c3c66a34

commit c42de78032ea24d6431412e2aec35383c3c66a34
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-09-14 11:33:09 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-09-28 09:46:34 +0000

    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

 security/olm/files/patch-include_olm_list.hh (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-09-28 09:49:18 UTC
A commit in branch 2024Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ca0626f2f34caa27f3457418b1a694fc684705f5

commit ca0626f2f34caa27f3457418b1a694fc684705f5
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-09-14 11:33:09 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-09-28 09:48:24 +0000

    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)

 security/olm/files/patch-include_olm_list.hh (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)