bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #60639] src/utils/addftinfo/addftinfo.cpp:119: double increment ?


From: David Binderman
Subject: [bug #60639] src/utils/addftinfo/addftinfo.cpp:119: double increment ?
Date: Thu, 20 May 2021 13:42:32 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

Follow-up Comment #3, bug #60639 (project groff):

[comment #2 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.

Thanks for the clarification. I had my suspicions.

> David, it is well known that modern C compilers emit huge 
> amounts of badly misleading, totally bogus warnings by default.

Thanks for your opinion. I suspect that developers of modern
C compilers might have something to say about that.

> Please never report compiler warnings to any project unless you >have
checked that the code is really wrong,

I think i += 2 in the last part of the for loop specifier
might make the programmer's original intent more clear.

Something like:

  for (i = 1; i < argc && argv[i][0] == '-'; i += 2) {

I can't imagine this change makes much difference at run time, however.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60639>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]