Document object lifetimes
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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