I am trying to assign the address of an unsigned integer to a pointer but cannot get rid of a MISRA 10.3 or 10.1 warning:
uint16_t Search_Key = 200U;
uint16_t *ptrSearch_Key;
ptrSearch_Key = (uint16_t *) (&Search_Key); /* MISRA 10.3 error */
ptrSearch_Key = &Search_Key; /* MISRA 10.1 error */
I found a similar posr here for another processor:
Am I seeing a bug or a genuine error in my code?
Thanks, Nick.