You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/01/03 12:56:11 UTC
[incubator-nuttx] branch master updated:
Documentation/NuttXCCodingStandard.html: Remove requirement to decorate
ignored returned values with (void). (#31)
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 06c2e86 Documentation/NuttXCCodingStandard.html: Remove requirement to decorate ignored returned values with (void). (#31)
06c2e86 is described below
commit 06c2e86d98925b8677bd8321db52425dc9fbfb19
Author: Gregory Nutt <sp...@gmail.com>
AuthorDate: Fri Jan 3 09:55:10 2020 -0300
Documentation/NuttXCCodingStandard.html: Remove requirement to decorate ignored returned values with (void). (#31)
Co-authored-by: Gregory Nutt <gn...@nuttx.org>
---
Documentation/NuttXCCodingStandard.html | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Documentation/NuttXCCodingStandard.html b/Documentation/NuttXCCodingStandard.html
index 2b187b5..74522f2 100644
--- a/Documentation/NuttXCCodingStandard.html
+++ b/Documentation/NuttXCCodingStandard.html
@@ -87,7 +87,7 @@
<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>
@@ -2182,9 +2182,8 @@ ptr = (FAR struct somestruct_s *)value;
<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.
- 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%">