[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #60639] src/utils/addftinfo/addftinfo.cpp:119: double increment ?
From: |
Ingo Schwarze |
Subject: |
[bug #60639] src/utils/addftinfo/addftinfo.cpp:119: double increment ? |
Date: |
Thu, 20 May 2021 13:24:22 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; OpenBSD amd64; rv:88.0) Gecko/20100101 Firefox/88.0 |
Update of bug #60639 (project groff):
Severity: 3 - Normal => 1 - Wish
Item Group: None => Warning/Suspicious
behaviour
Status: Need Info => Invalid
Open/Closed: Open => Closed
_______________________________________________________
Follow-up Comment #2:
Well, it is trivial to see that incrementing twice is correct given the
purpose of the code: once for the option and once for the argument.
> I just tried to compile the package with clang. It said:
> src/utils/addftinfo/addftinfo.cpp:119:5: warning:
> variable 'i' is incremented both in the loop header
> and in the loop body [-Wfor-loop-analysis]
David, it is well known that modern C compilers emit huge amounts of badly
misleading, totally bogus warnings by default.
Please never report compiler warnings to any project unless you have checked
that the code is really wrong, and always describe in detail why you think the
code is wrong if you think it is, in terms different from whatever the
compiler says.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60639>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/