|
|
|
|
|
by asgfoi
3784 days ago
|
|
I tried to compile it, and I also couldn't find any other flag, than -Wconversion, that would detect this: 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. |
|