Documentation/NuttXCCodingStandard.html: Remove requirement to decorate ignored returned values with (void). (#31)

Co-authored-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Gregory Nutt
2020-01-03 09:55:10 -03:00
committed by Alan Carvalho de Assis
parent 91d483591d
commit 06c2e86d98
+3 -4
View File
@@ -87,7 +87,7 @@
<h1><big><font color="#3c34ec"> <h1><big><font color="#3c34ec">
<i>NuttX C Coding Standard</i> <i>NuttX C Coding Standard</i>
</font></big></h1> </font></big></h1>
<p>Last Updated: July 6, 2019</p> <p>Last Updated: January 2, 2020</p>
</td> </td>
</tr> </tr>
</table> </table>
@@ -2182,9 +2182,8 @@ ptr = (FAR struct somestruct_s *)value;
<b>Checking Return Values</b>. <b>Checking Return Values</b>.
Callers of internal OS functions should always check return values for an error. Callers of internal OS functions should always check return values for an error.
At a minimum, a debug statement should indicate that an error has occurred. At a minimum, a debug statement should indicate that an error has occurred.
The calling logic intentionally ignores the returned value, then the function return value should be explicitly cast to <code>(void)</code> to indicate that the return value is intentionally ignored. Ignored return values are always suspicious.
An exception of for standard functions for which people have historically ignored the returned values, such as <code>printf()</code> or <code>close</code>. All calls to <code>malloc</code> or <code>realloc</code>, in particular, must be checked for failures to allocate memory to avoid use of NULL pointers.
All calls to <code>malloc</code> or <code>realloc</code> must be checked for failures to allocate memory.
</p> </p>
<table width ="100%"> <table width ="100%">