Defensive programming: Difference between revisions

Content deleted Content added
No edit summary
Line 95:
;Offensive programming
<syntaxhighlight lang="c">
// TrustExpect that the new code has no new bugs
if (new_code(user_config); != OK) {
// Loudly report and abruptly terminate program to get proper attention
report_error("Something went very wrong");
exit(-1);
}
</syntaxhighlight>