From 06c2e86d98925b8677bd8321db52425dc9fbfb19 Mon Sep 17 00:00:00 2001
From: Gregory Nutt
Date: Fri, 3 Jan 2020 09:55:10 -0300
Subject: [PATCH] Documentation/NuttXCCodingStandard.html: Remove requirement
to decorate ignored returned values with (void). (#31)
Co-authored-by: Gregory Nutt
---
Documentation/NuttXCCodingStandard.html | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Documentation/NuttXCCodingStandard.html b/Documentation/NuttXCCodingStandard.html
index 2b187b50fc1..74522f2ed27 100644
--- a/Documentation/NuttXCCodingStandard.html
+++ b/Documentation/NuttXCCodingStandard.html
@@ -87,7 +87,7 @@
NuttX C Coding Standard
- Last Updated: July 6, 2019
+ Last Updated: January 2, 2020
@@ -2182,9 +2182,8 @@ ptr = (FAR struct somestruct_s *)value;
Checking Return Values.
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 (void) 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 printf() or close.
- All calls to malloc or realloc must be checked for failures to allocate memory.
+ Ignored return values are always suspicious.
+ All calls to malloc or realloc, in particular, must be checked for failures to allocate memory to avoid use of NULL pointers.