<!DOCTYPE qhelp PUBLIC
  "-//Semmle//qhelp//EN"
  "qhelp.dtd">
<qhelp>


<overview>

<!-- Mention that this rule may not be applicable in projects that don't follow the JSF standard. -->
<include src="cpp/jsfNote.qhelp" />

<p>
This query highlights calls to the standard library functions <code>abort, exit, getenv</code> and <code>system</code>.
The functions <code>abort</code> and <code>exit</code> should not be called as they immediately terminate the program
and will bypass all the normal error and exception handling routines in the software. This is especially important in
software which is run on systems without an interactive OS, as restarting the software may require a complete reboot
of the system. <code>getenv</code> and <code>system</code> will usually not work at all on systems that do not have a 
command processor.
</p>


</overview>
<recommendation>
<p>
Do not use any of the functions mentioned above. Use the error/exception handling mechanism of the software system you are using 
instead of <code>exit</code> or <code>abort</code>, or write your own functions to emulate the functionality provided
by running OS commands through <code>system</code> and <code>getenv</code>.
</p>

</recommendation>
<example><sample src="AV Rule 24.cpp" />



</example>
<references>

<li>AV Rule 24, <em>Joint Strike Fighter Air Vehicle C++ Coding Standards</em>. Lockheed Martin Corporation, 2005.
</li></references></qhelp>
