Version 20 seems to get confused by anonymous unions. For version 20 the symbol coloring for the member function below shows params.cumulativeTestCount in red (unknown symbol) and if I hover over it I get "Symbol color:symbol not found."
Version 19 handles it fine.
I did already retag the project for version 20.
Here is the function (in .cpp file):
void ConfigParams::setCumulativeTestCount(U32 count)
{
params.cumulativeTestCount = count;
updateCrc();
(void)writeToEeprom();
}
Here is the class definition (in .h file):
class ConfigParams
{
friend S16 debugFunctions(void);
public:
ConfigParams(void);
~ConfigParams(void);
U32 getCumulativeTestCount(void) const;
U32 incrementCumulativeTestCount(void);
void setSerialNumber(const Char *serNum);
void getSerialNumber(Char *serNum) const;
static bool initialize(void);
bool crcIsValid(void) const;
bool readFromEeprom(void);
private:
union
{
struct
{
U32 cumulativeTestCount;
Char serialNumber[SERIAL_NUMBER_LENGTH];
} params;
// raw element ensures that the size of the class is a multiple
// of 4 bytes, with the CRC in the last 2 bytes (assuming
// DEVICE_CONFIG_EEPROM_BYTES is a multiple of 4 bytes)
U8 raw[DEVICE_CONFIG_EEPROM_BYTES - sizeof(U32)];
};
U16 pad; // needed to align crc in last two bytes of the block
U16 crc;
void updateCrc(void);
bool writeToEeprom(void) const;
void setCumulativeTestCount(U32 count);
};