Hi! I'm reading MAC addresses (in standard hex notation, e.g. 00:11:22:33:44:55) from stdin and converting them into a 6 byte variable hw_addr as decimals:
u8 hw_addr[6];
scanf("%2x:%2x:%2x:%2x:%2x:%2x", &hw_addr[0], &hw_addr[1], &hw_addr[2], &hw_addr[3], &hw_addr[4], &hw_addr[5]);
The only problem is that I'm getting 6 scanf warnings:
warning: format '%2x' expects type 'unsigned int *', but argument 3 has type 'u8 *'
.....
Any way to get rid of these warnings without wasting an int for each field?