by asgfoi · 10y ago · 0 comments
for(i = 0; i < length; i++) sum += a[i] * b[i];
^
I managed to hide the error if return values, which are double, are replaced with float_t. I believe in that case the bug stays in, but -Wconversion doesn't detect it.Of course the warning can always be silenced by doing something like:
for(i = 0; i < length; i++) sum += ( double )( a[i] * b[i] );
and adding a misleading comment about the explicit cast.