structures in C

gk123987's Avatar
Go4Expert Member
admac_status = ADMAC.ADMATE0.BYTE;
ADMAC.ADMATE0.BYTE = (U8)~(HWI_SPI_ADMAC_RSPIB_MASK);
(void)ADMAC.ADMATE0.BYTE;

what is the need for the void typecasting ?
0
gk123987's Avatar
Go4Expert Member
Note: ADMAC is a structure with one of its elt as ADMATE0 which is also a structure having BYTE as one of its union elt.
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
My guess is that the cast is there to suppress a warning. The statement has no effect (which could be what the warning would be if the cast were removed). You would need to ask the original programmer why that line is there; it seems pointless to me.