31-10-2005, 04:35 PM
The rules 17.1 to 17.3 give some possibilities to manipulate pointers (arithmetic, substraction, comparison) whereas the rule 17.4 doesn't authorize pointer manipulation in any way other than array indexing.
Should it be possible to explain me where I make a mistake in my understanding?
In particular, I would like to know if the following code is MISRA 2004 compliant concerning pointer manipulation:
I thank you in advance.
Best regards.
Should it be possible to explain me where I make a mistake in my understanding?
In particular, I would like to know if the following code is MISRA 2004 compliant concerning pointer manipulation:
Code:
unsigned int tab[10];
void test(void)
{
unsigned int *ptr;
ptr = &tab[2];
*ptr = 33;
ptr++; /* MISRA Compliant ? */
*ptr = 11;
}
I thank you in advance.
Best regards.