8f3459b3db
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 <flavio.ceolin@intel.com>
23 lines
434 B
Plaintext
23 lines
434 B
Plaintext
/// Cast void to memset to ignore its return value
|
|
///
|
|
//# 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
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
virtual patch
|
|
|
|
@depends on patch && !(file in "ext")@
|
|
expression e1,e2,e3;
|
|
@@
|
|
(
|
|
+ (void)
|
|
memset(e1,e2,e3);
|
|
|
|
|
+ (void)
|
|
memcpy(e1,e2,e3);
|
|
)
|