JargonFile/original/html/C/can-t-happen.html
2014-03-27 18:54:56 +00:00

14 lines
2.4 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>can't happen</title><link rel="stylesheet" href="../../jargon.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"/><link rel="home" href="../index.html" title="The Jargon File"/><link rel="up" href="../C.html" title="C"/><link rel="previous" href="camelCasing.html" title="camelCasing"/><link rel="next" href="cancelbot.html" title="cancelbot"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">can't happen</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="camelCasing.html">Prev</a> </td><th width="60%" align="center">C</th><td width="20%" align="right"> <a accesskey="n" href="cancelbot.html">Next</a></td></tr></table><hr/></div><dt><a id="can-t-happen"/><dt xmlns="" id="can-t-happen"><b>can't happen</b></dt></dt><dd><p> The traditional program comment for code executed under a condition
that should never be true, for example a file size computed as negative.
Often, such a condition being true indicates data corruption or a faulty
algorithm; it is almost always handled by emitting a fatal error message
and terminating or crashing, since there is little else that can be done.
Some case variant of &#8220;<span class="quote">can't happen</span>&#8221; is also often the text
emitted if the &#8216;impossible&#8217; error actually happens! Although
&#8220;<span class="quote">can't happen</span>&#8221; events are genuinely infrequent in production
code, programmers wise enough to check for them habitually are often
surprised at how frequently they are triggered during development and how
many headaches checking for them turns out to head off. See also
<a href="../F/firewall-code.html"><i class="glossterm">firewall code</i></a> (sense 2).</p></dd><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="camelCasing.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="../C.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="cancelbot.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">camelCasing </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> cancelbot</td></tr></table></div></body></html>