LLNL / dataracebench

Data race benchmark suite for evaluating OpenMP correctness tools aimed to detect data races.
Other
67 stars 29 forks source link

DRB181-SmithWaterman-yes.c uses abs with long #135

Closed jprotze closed 2 years ago

jprotze commented 2 years ago
micro-benchmarks/DRB181-SmithWaterman-yes.c:108:30: warning: absolute value function 'abs' given an argument of type 'long long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
        return 2 * min - i + abs(m - n) - 2;
                             ^
micro-benchmarks/DRB181-SmithWaterman-yes.c:108:30: note: use function 'llabs' instead
        return 2 * min - i + abs(m - n) - 2;
                             ^~~
                             llabs

Additionally, the function mixes long int and long long int valiables. Is this on purpose?

peihunglin commented 2 years ago

This benchmark was simplified based on the version available at https://github.com/TheFighters/Smith-Waterman.
We can revise to avoid the warning from Clang and the mix use of the types.

peihunglin commented 2 years ago

The fixes are added to avoid the warning and mixed use of types.