[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tlf-devel] Quelling a warning from clang6
From: |
Nate Bargmann |
Subject: |
[Tlf-devel] Quelling a warning from clang6 |
Date: |
Tue, 6 Nov 2018 04:38:29 -0600 |
User-agent: |
NeoMutt/20180716 |
I occasionally go through the projects and test with clang as it will
often catch things GCC is silent on. I've been doing so with clang6 and
Hamlib and did the same with Tlf. I can report that clang6 only
generated warnings on one file (good job, all!) and that is bandmap.c.
Actually it is the same warning that occurs three places in the file:
bandmap.c:322:6: warning: taking the absolute value of unsigned type 'unsigned
int' has no effect [-Wabsolute-value]
if (abs(((spot *)found->data)->freq - freq) > TOLERANCE) {
^
bandmap.c:322:6: note: remove the call to 'abs' since unsigned values cannot be
negative
if (abs(((spot *)found->data)->freq - freq) > TOLERANCE) {
^~~
The suggested fix appears easy enough, but I don't use the bandmap, so
my testing would likely be incomplete. I would like to hear from anyone
who uses the bandmap to remove the call to abs and do some testing.
For reference, in addition to line 322 above, the same warning is
generated for lines 381 and 390.
73, Nate
--
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
Web: http://www.n0nb.us GPG key: D55A8819 GitHub: N0NB
signature.asc
Description: PGP signature
- [Tlf-devel] Quelling a warning from clang6,
Nate Bargmann <=