mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
added rule about not modifying return values when failing
This commit is contained in:
parent
337ca18384
commit
4d7bd2d694
1 changed files with 6 additions and 1 deletions
|
|
@ -15,7 +15,7 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: coding.html,v 1.13 2000/08/01 01:18:21 tale Exp $ -->
|
||||
<!-- $Id: coding.html,v 1.14 2000/09/19 22:47:14 gson Exp $ -->
|
||||
|
||||
<H2>C Language</H2>
|
||||
|
||||
|
|
@ -346,6 +346,11 @@ Bad (obviously for more than one reason ...):
|
|||
A function should report success or failure, and do so accurately. It
|
||||
should never fail silently. Use of Design by Contract can help here.<P>
|
||||
|
||||
When a function is designed to return results to the caller by
|
||||
assigning to caller variables through pointer arguments, it should
|
||||
perform the assignment only if it succeeds and leave the variables
|
||||
unmodified if it fails.<P>
|
||||
|
||||
<H4>Testing Bits</H4>
|
||||
Bit testing should be as follows:<P>
|
||||
Good:
|
||||
|
|
|
|||
Loading…
Reference in a new issue