Skip to content

Typo Fixes in test.c for RULE-6-1 and RULE-6-2 #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions c/misra/test/rules/RULE-6-1/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ enum Color { R, G, B };

struct SampleStruct {
int x1 : 2; // NON_COMPLIANT - not explicitly signed or unsigned
unsigned int x2 : 2; // COMPILANT - explicitly unsigned
signed int x3 : 2; // COMPILANT - explicitly signed
unsigned int x2 : 2; // COMPLIANT - explicitly unsigned
signed int x3 : 2; // COMPLIANT - explicitly signed
UINT16 x4 : 2; // COMPLIANT - type alias resolves to a compliant type
signed long x5 : 2; // NON_COMPLIANT - cannot declare bit field for long, even
// if it's signed
signed char x6 : 2; // NON_COMPILANT - cannot declare bit field for char, even
signed char x6 : 2; // NON_COMPLIANT - cannot declare bit field for char, even
// if it's signed
enum Color x7 : 3; // NON_COMPILANT - cannot declare bit field for enum
enum Color x7 : 3; // NON_COMPLIANT - cannot declare bit field for enum
} sample_struct;
14 changes: 7 additions & 7 deletions c/misra/test/rules/RULE-6-2/test.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#include <stdint.h>

struct SampleStruct {
int x1 : 1; // NON_COMPILANT: very likely be signed, but if it's not, the
int x1 : 1; // NON_COMPLIANT: very likely be signed, but if it's not, the
// query will automatically handle it since we use signed(), not
// isExplicitlySigned().
signed int x2 : 1; // NON_COMPILANT: single-bit named field with a signed type
signed int x2 : 1; // NON_COMPLIANT: single-bit named field with a signed type
signed char
x3 : 1; // NON_COMPILANT: single-bit named field with a signed type
x3 : 1; // NON_COMPLIANT: single-bit named field with a signed type
signed short
x4 : 1; // NON_COMPILANT: single-bit named field with a signed type
x4 : 1; // NON_COMPLIANT: single-bit named field with a signed type
unsigned int
x5 : 1; // COMPILANT: single-bit named field but with an unsigned type
signed int x6 : 2; // COMPILANT: named field with a signed type but declared
x5 : 1; // COMPLIANT: single-bit named field but with an unsigned type
signed int x6 : 2; // COMPLIANT: named field with a signed type but declared
// to carry more than 1 bit
signed char : 1; // COMPILANT: single-bit bit-field but unnamed
signed char : 1; // COMPLIANT: single-bit bit-field but unnamed
} sample_struct;