From 5bb496bfeec16c91cbfa938c8c2b521b22fd039b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 2 Jan 2020 21:26:57 -0600 Subject: [PATCH] Documentation/NuttXCCodingStandard.html: Remove requirement to decorate ignored returned values with (void). --- Documentation/NuttXCCodingStandard.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/NuttXCCodingStandard.html b/Documentation/NuttXCCodingStandard.html index 2b187b50fc110..74522f2ed2710 100644 --- a/Documentation/NuttXCCodingStandard.html +++ b/Documentation/NuttXCCodingStandard.html @@ -87,7 +87,7 @@

Table of Contents

NuttX C Coding Standard

-

Last Updated: July 6, 2019

+

Last Updated: January 2, 2020

@@ -2182,9 +2182,8 @@

Returned Values

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.