cppcheck/addons/test/misra/misra-ctu-2-test.c

33 lines
794 B
C
Raw Normal View History

2021-07-07 10:58:13 +02:00
// Test with command:
// ./cppcheck --addon=misra --inline-suppr addons/test/misra/misra-ctu-*-test.c
#include "misra-ctu-test.h"
2021-07-07 15:16:53 +02:00
MISRA_2_3_B misra_2_3_b;
2021-07-09 09:47:23 +02:00
x = MISRA_2_5_OK_2;
2021-07-07 10:58:13 +02:00
// cppcheck-suppress misra-c2012-5.6
typedef int MISRA_5_6_VIOLATION;
2021-07-07 15:16:53 +02:00
static MISRA_5_6_VIOLATION misra_5_6_x;
2021-07-07 10:58:13 +02:00
2021-07-07 21:47:17 +02:00
// cppcheck-suppress misra-c2012-5.7
struct misra_5_7_violation_t {
int x;
};
2021-07-10 12:51:40 +02:00
static misra_5_7_violation_t misra_5_7_use_type_2;
2021-07-08 22:03:27 +02:00
2021-07-09 09:47:23 +02:00
// cppcheck-suppress misra-c2012-5.8
2021-07-10 12:51:40 +02:00
static int misra_5_8_var1;
2021-07-10 20:10:44 +02:00
// cppcheck-suppress misra-c2012-8.4
2021-07-09 09:47:23 +02:00
// cppcheck-suppress misra-c2012-5.8
2021-07-10 12:51:40 +02:00
void misra_5_8_f(void) {
// cppcheck-suppress misra-c2012-5.8
char misra_5_8_var2;
}
2021-07-09 09:47:23 +02:00
2021-07-10 12:51:40 +02:00
// cppcheck-suppress misra-c2012-5.9
static int misra_5_9_count;
// cppcheck-suppress misra-c2012-5.9
static void misra_5_8_foo(void) {}