Usless assigments to argument
A pull request for this has already been merged.
- #905 by @Steven-Roberts — merged
- Dominant language
- C
- Stars
- 686
- Forks
- 167
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 17
Description
In these places:
https://github.com/llnl/sundials/blob/178eae817c7a5338e5f572d3a62d8cb6b4728fce/src/sundials/sundials_direct.c#L182
https://github.com/llnl/sundials/blob/178eae817c7a5338e5f572d3a62d8cb6b4728fce/src/sundials/sundials_direct.c#L260
https://github.com/llnl/sundials/blob/178eae817c7a5338e5f572d3a62d8cb6b4728fce/src/sundials/sundials_direct.c#L266
https://github.com/llnl/sundials/blob/178eae817c7a5338e5f572d3a62d8cb6b4728fce/src/sundials/sundials_nvector.c#L1080
NULL is assigned to a local copy of the pointer - this assignment has no effect for the caller (cf. example at godbolt).
Contributor guide
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 with the four linked locations in src/sundials/sundials_direct.c and src/sundials/sundials_nvector.c, and inspect how each pointer argument is used around the assignment. Remove only assignments that affect a local pointer copy rather than the caller, then verify the resulting SUNDIALS changes with the project’s normal validation process.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100