python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
cannot cast 'float64' to different essential type 'unsigned16' [MISRA 2012 Rule 10.8, required]
cannot cast 'float64' to different essential type 'unsigned16' [MISRA 2012 Rule 10.8, required]
double x, y;
#define MIN 2.0
uint16_t z = (uint16_t) ((x * MIN) + y);
How can I resolve this line throw...
user8454941
Votes: 0
Answers: 2
Which form is better for return value of functions in embedded C?
I am working on embedded C. Could somebody help me which piece of code?
Is efficient in terms of robustness, memory as well as Misra friendly?
Code1:
if (func() == 1 || func() == 2) {
/* Body of t...
Shreevatsa Tilgul
Votes: 0
Answers: 3
Pointer alignment not compatible with MISRA-C 2012
I'm trying to convert a certain pointer as follows:
I have this struct:
typedef struct {
/** Interface index */
uint8_t if_index;
/** flags */
uint32_t flags; /* error */
/** packet id */
...
weaver20
Votes: 0
Answers: 2
Pc lint "-egrep" option
I'm trying to clean up my code from misra violations using Pc-lint.
One of them is the violation to rule 11.4 in this code.
GPIO_PinState level = HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6);
the definition o...
buch
Votes: 0
Answers: 1