Skip to content

Get_count: Return nothing on failure - #976

Open
eschnett wants to merge 3 commits into
masterfrom
claude/correctness-issue-16-undefined
Open

Get_count: Return nothing on failure#976
eschnett wants to merge 3 commits into
masterfrom
claude/correctness-issue-16-undefined

Conversation

@eschnett

@eschnett eschnett commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Return nothing instead of the (ABI-dependent) integer value MPI_UNDEFINED on failure.

Add explicit checks for nothing in the caller. (Previously there was no error handling there.)

Return `nothing` instead of the (ABI-dependent) integer value
`MPI_UNDEFINED` on failure.

Add explicit checks for `nothing` in the caller. (Previously there was
no error handling there.)
@vchuravy

vchuravy commented Sep 9, 2026

Copy link
Copy Markdown
Member

This is technically a breaking change

@eschnett

eschnett commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Yes, technically it is breaking. But I want to argue that the previous state was ill-defined: Returning MPI_UNDEFINED returns a system-dependent constant on error.

Also, all other similar functions already return nothing on error. Thus I'd call it "correcting the code by adding the missing error handling branch".

@eschnett
eschnett requested a review from vchuravy September 10, 2026 19:12
@eschnett

Copy link
Copy Markdown
Contributor Author

@vchuravy is your 👍 approval for this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants