Closed kjmeagher closed 1 year ago
The variable is always used, and the compiler warning is arguably wrong-ish, but see if the change in https://github.com/icecube/photospline/pull/33 cleans this up for you.
That solution removes the warning, but I don't see why the warning is wrong, dummy is never accessed
The value is never loaded (since the variable is defined locally it cannot be used from elsewhere and cannot be something memory mapped) but the variable is used as a sink to ensure that the result of the calculations being benchmarked cannot be optimized away, as removing writes to volatile variables is forbidden. So, the compiler is trying to be helpful about identifying dead code, but does not actually understand the context, so while the warning is technically correct (up to poor wording), it is not useful.
I am getting a lot of warnings like this from code that uses photo spline. It looks like dummy is only being used on certain code paths