openSUSE / openSUSE/libsolv

Document object lifetimes

Open
#239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation :memo:
Dominant language
C
Stars
609
Forks
177
PR merge metrics
No merged PRs in 30d

Description

There are various APIs, such as pool_solvable2str which return pointers with undefined lifetimes. E.g. one would assume that repeated calls to pool_solvable2str wouldn't invalidate previously returned strings, but that is not the case. (See https://github.com/rpm-software-management/libdnf/pull/388 for the resulting confusion). Another one which seems to use a temporary buffer is solvable_lookup_location. We also have similar questions about other APIs such as pool_id2str.

Can we annotate the documentation of such APIs with lifetime guarantees of returned values?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the documentation for pool_solvable2str, solvable_lookup_location, and pool_id2str, then inspect their returned-value behavior and existing lifetime wording. Document lifetime guarantees for these and similarly affected APIs, with the undefined or temporary-buffer behavior made explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.