Skip to content

Commit 42e2b04

Browse files
Internal: fixed analysis errors in A2-11-1 A2-7-3 #4837 [autosync]
1 parent 0a2e59a commit 42e2b04

2 files changed

Lines changed: 13 additions & 16 deletions

File tree

CodeCheck/Published Standards/AUTOSAR/A2-11-1/volatileKeywordShallNotBeUsed.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <cstdio>
2-
31
int main (){
42
//this volatile should not be included
53
volatile int value; // UndCC_Violation
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
//% $Id: A2-7-3.hpp 305382 2018-01-26 06:32:15Z michal.szczepankiewicz $
2-
#include <cstdint>
32

4-
typedef int16_t new_int; // UndCC_Violation
3+
typedef short new_int; // UndCC_Violation
54

65
/// union sample
76
/// @brief union for S
87
union S
98
{
10-
std::int32_t n; // occupies 4 bytes // UndCC_Violation
11-
std::uint16_t s[2]; // occupies 4 bytes // UndCC_Violation
12-
std::uint8_t c; // occupies 1 byte // UndCC_Violation
9+
int n; // occupies 4 bytes // UndCC_Violation
10+
unsigned short s[2]; // occupies 4 bytes // UndCC_Violation
11+
unsigned char c; // occupies 1 byte // UndCC_Violation
1312
};
1413

1514
struct product // UndCC_Violation
@@ -24,10 +23,10 @@ enum colors // UndCC_Violation
2423
black
2524
};
2625

27-
void F1(std::int32_t) noexcept; // UndCC_Violation documentation
26+
void F1(int) noexcept; // UndCC_Violation documentation
2827

29-
std::int32_t F2(std::int16_t input1, // UndCC_Violation
30-
std::int32_t input2);
28+
int F2(short input1, // UndCC_Violation
29+
int input2);
3130

3231
/// @brief Function description
3332
///
@@ -36,9 +35,9 @@ std::int32_t F2(std::int16_t input1, // UndCC_Violation
3635
/// @throw std::runtime_error conditions to runtime_error occur
3736
///
3837
/// @return return value description
39-
std::int32_t F3(
40-
std::int16_t input1,
41-
std::int16_t input2) noexcept(false); // UndCC_Valid documentation
38+
int F3(
39+
short input1,
40+
short input2) noexcept(false); // UndCC_Valid documentation
4241

4342
/// @brief Class responsibility
4443
class C // UndCC_Valid documentation
@@ -48,16 +47,16 @@ class C // UndCC_Valid documentation
4847
///
4948
/// @param input1 input1 parameter description
5049
/// @param input2 input2 parameter description
51-
C(std::int32_t input1, float input2) : x{input1}, y{input2} {}
50+
C(int input1, float input2) : x{input1}, y{input2} {}
5251

5352
/// @brief Method description
5453
///
5554
/// @return return value descrption
56-
std::int32_t const *GetX() const noexcept { return &x; }
55+
int const *GetX() const noexcept { return &x; }
5756

5857
private:
5958
/// @brief Data member descpription
60-
std::int32_t x;
59+
int x;
6160
/// @brief Data member descpription
6261
float y;
6362
};

0 commit comments

Comments
 (0)