I have declared macros like this:
#define F_MASK_4_BIT 0xF
#define GET_F_4BIT_MASK(F, P) (((F) & (F_MASK_4_BIT << (P * 4))) >> (4 * P))
using macro like this:
uint8_t Feature = GET_F_4BIT_MASK(E, P);
Where E is uint64_t datatype P is uint8_t datatype
Which gives warning by Prefast: C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value.
How to fix this?