Compiler issues "(350) unused member" warning for uninitialized members when a structure pointer is passed to a fastcall16 function. Since a struct pointer is passed, the called function may write these values (which happens in this case), so initializing all members is wasteful. While it's a minor thing and I'm being picky, I want to avoid warnings.
Code:
{
struct {
BYTE bARG_BlockId; // block ID
BYTE *pARG_FlashBuffer; // flash buffer pointer - 2 bytes
CHAR cARG_Temperature; // die Temperature, -40 to 100
BYTE bDATA_PWErase; // Temporary storage (reserved)
BYTE bDATA_PWProgram; // Temporary storage (reserved)
BYTE bDATA_PWMultiplier; // Temporary storage (reserved)
} fooStruct;
fooStruct.bARG_BlockId = SNP_EEP_BLK_NUM;
fooStruct.pARG_FlashBuffer = (char *)&net;
fooStruct.cARG_Temperature = 25;
if (bFlashWriteBlock((FLASH_WRITE_STRUCT*)&fooStruct) == 0) {
######################
!W ./snp_protocol.c(931):(350) unused member "bDATA_PWErase" (from line 921) (warning)
!W ./snp_protocol.c(931):(350) unused member "bDATA_PWProgram" (from line 922) (warning)
!W ./snp_protocol.c(931):(350) unused member "bDATA_PWMultiplier" (from line 923) (warning)