Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Documentation/NuttXCCodingStandard.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h1>Table of Contents</h1>
<h1><big><font color="#3c34ec">
<i>NuttX C Coding Standard</i>
</font></big></h1>
<p>Last Updated: July 6, 2019</p>
<p>Last Updated: January 2, 2020</p>
</td>
</tr>
</table>
Expand Down Expand Up @@ -2182,9 +2182,8 @@ <h2><a name="retvalues">Returned Values</a></h2>
<b>Checking Return Values</b>.
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.
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the relaxation? What was the argument for these changes?

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> must be checked for failures to allocate memory.
Ignored return values are always suspicious.
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.
</p>

<table width ="100%">
Expand Down