Skip to content

Commit 9f6948d

Browse files
committed
rfc7: no side effects on error
Problem: we have internalized an expectation that functions do not have side effects on error, but this is undocumented. Add this to RFC 7.
1 parent ab20527 commit 9f6948d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec_7.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ Examples:
192192
In order to represent the full range of values, enums that use a zero for none
193193
or similar SHOULD include an item with the value zero to represent that state.
194194

195+
Error Handling
196+
==============
197+
198+
A function SHOULD NOT have side effects on failure. For example, a function
199+
that takes a reference on an object parameter SHOULD NOT take the reference
200+
when it signifies to the caller that it has failed.
201+
195202
Tools for C formatting
196203
======================
197204

0 commit comments

Comments
 (0)