From 8f3459b3db80f61bffc320ae7aa036b255d43eb7 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Tue, 18 Dec 2018 12:11:49 -0800 Subject: [PATCH] coccinelle: Updating ignore_return to support memcpy The return of memcpy was being ignored just like memset's return. Just adding it to coccinelle script. MISRA-C rule 17.7 Signed-off-by: Flavio Ceolin --- scripts/coccinelle/ignore_return.cocci | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/coccinelle/ignore_return.cocci b/scripts/coccinelle/ignore_return.cocci index a6712b037b..8ab42387b3 100644 --- a/scripts/coccinelle/ignore_return.cocci +++ b/scripts/coccinelle/ignore_return.cocci @@ -1,7 +1,7 @@ /// Cast void to memset to ignore its return value /// -//# The return of memset is never checked and therefore cast -//# it to void to explicitly ignore while adhering to MISRA-C. +//# The return of memset and memcpy is never checked and therefore +//# cast it to void to explicitly ignore while adhering to MISRA-C. // // Confidence: High // Copyright (c) 2017 Intel Corporation @@ -13,7 +13,10 @@ virtual patch @depends on patch && !(file in "ext")@ expression e1,e2,e3; @@ - +( + (void) memset(e1,e2,e3); - +| ++ (void) +memcpy(e1,e2,e3); +)