GNU bug report logs - #45562
[PATCH] Fix "comparison always the same" warnings found by lgtm

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Thu, 31 Dec 2020 08:34:01 UTC

Severity: wishlist

Tags: patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 45562 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 45562 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#45562: [PATCH] Fix "comparison always the same" warnings
 found by lgtm
Date: Wed, 21 Jul 2021 13:30:10 +0200
Andreas Schwab <schwab <at> linux-m68k.org> writes:

>>>> --- a/src/fns.c
>>>> +++ b/src/fns.c
>>>> @@ -3847,8 +3847,6 @@ base64_decode_1 (const char *from, char *to, ptrdiff_t length,
>>>>        if (c == '=')
>>>>  	continue;
>>>>
>>>> -      if (v1 < 0)
>>>> -	return -1;
>
> Looking at commit 5abaea334cf, that likely needs to test v1 == 0 instead.

Seems like so to me, too.  So I've now made that change on the trunk --
so the lgtm checks found a real bug there.

As for the others, skimming this thread there didn't seem to be any
consensus that the proposed changes makes the code any better (or
clearer), so applying those doesn't seem to be a net win, and I'm
closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.