Though when pointer come into play it is always dangerous.
const DeviceStateStructure* dsspDeviceState // A pointer to the state structure of given device.
= &(s_dssaDevices[swDevice]);
Is the value of dsspDeviceState correct? It depends on the memory of s_dssaDevices and whether swDevice is out of bounds or not.
I didn't understand what do you mean by: "It depends on the memory of s_dssaDevices and whether swDevice is out of bounds or not"
What came before is: static DeviceStateStructure s_dssaDevices[sitalMaximum_DEVICES] = {}; // An array of device state information.
s_dssaDevices defined as global static
sitalMaximum_DEVICES defined as 8
I assign pointer to represent swDevice state structure
What could be the problem here?
Well, we do see that there are sitalMaximum_DEVICES number of DeviceStateStructure objects in it.
Well, it's an array of that size - but every element is the same and they may or may not have been initialised, depending on what a DeviceStateStructure is.