← Commit list

122a8cbd4

Denys Vlasenko
Denys Vlasenko
2019-10-25
SUCCESS Duration: 154s

Subject

hdparm: placate "warning: taking the absolute value of unsigned type"

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

miscutils/hdparm.c+1 -1
@@ -996,7 +996,7 @@ static void identify(uint16_t *val)
/* check Endian of capacity bytes */
nn = val[LCYLS_CUR] * val[LHEADS_CUR] * val[LSECTS_CUR];
oo = (uint32_t)val[CAPACITY_LSB] << 16 | val[CAPACITY_MSB];
- if (abs(mm - nn) > abs(oo - nn))
+ if (abs((int)(mm - nn)) > abs((int)(oo - nn)))
mm = oo;
}
printf("\tCHS current addressable sectors:%11u\n", mm);