Unchecked return value on third party code
joel at rtems.org
Tue Feb 23 15:23:54 UTC 2021
Ryan has wandered into the land of third party code and Coverity issues. It
is not a very welcoming land and we need to decide what we want to do as a
project. I put one
In these cases, we have a few patterns to fall back on. There are basically
a few choices here:
+ ignore third party code in Coverity. I'm not a fan since we still have
code with issues.
+ Do the minimum which is often just adding (void) in front of the call
not checking a return code..Still wrap in #ifdef __rtems__ as below with a
more robust solution.
+ Add #ifdef __rtems__ so the original code and rtems changes are side by
side. This is more like what we do with libbsd. But I would still tend to
use the correct fix and not just slap a (void) in front. If we are going to
modify the file, we might as well fix it.
rc = XXX
Any other options? Opinions.
CID 1047324: Unchecked return value in fdt_add_subnode_namelen().
cpukit/dtc/libfdt/fdt_rw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpukit/dtc/libfdt/fdt_rw.c b/cpukit/dtc/libfdt/fdt_rw.c
index 1385425..ceeeb44 100644
@@ -348,7 +348,7 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
/* Try to place the new node after the parent's properties */
- fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
+ (void)fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the
offset = nextoffset;
tag = fdt_next_tag(fdt, offset, &nextoffset);
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel