Skip to content

Commit

Permalink
rfc7: no side effects on error
Browse files Browse the repository at this point in the history
Problem: we have internalized an expectation that functions do not
have side effects on error, but this is undocumented.

Add this to RFC 7.
  • Loading branch information
garlick committed Dec 2, 2024
1 parent ab20527 commit 9f6948d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec_7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ Examples:
In order to represent the full range of values, enums that use a zero for none
or similar SHOULD include an item with the value zero to represent that state.

Error Handling
==============

A function SHOULD NOT have side effects on failure. For example, a function
that takes a reference on an object parameter SHOULD NOT take the reference
when it signifies to the caller that it has failed.

Tools for C formatting
======================

Expand Down

0 comments on commit 9f6948d

Please sign in to comment.