Skip to content

Commit 8f3459b

Browse files
Flavio Ceolincarlescufi
Flavio Ceolin
authored andcommitted
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 <[email protected]>
1 parent 27435e4 commit 8f3459b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// Cast void to memset to ignore its return value
22
///
3-
//# The return of memset is never checked and therefore cast
4-
//# it to void to explicitly ignore while adhering to MISRA-C.
3+
//# The return of memset and memcpy is never checked and therefore
4+
//# cast it to void to explicitly ignore while adhering to MISRA-C.
55
//
66
// Confidence: High
77
// Copyright (c) 2017 Intel Corporation
@@ -13,7 +13,10 @@ virtual patch
1313
@depends on patch && !(file in "ext")@
1414
expression e1,e2,e3;
1515
@@
16-
16+
(
1717
+ (void)
1818
memset(e1,e2,e3);
19-
19+
|
20+
+ (void)
21+
memcpy(e1,e2,e3);
22+
)

0 commit comments

Comments
 (0)