bug-ncurses
[Top][All Lists]
Advanced

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

Re: infocmp.c:804: possible bad if test ?


From: Thomas Dickey
Subject: Re: infocmp.c:804: possible bad if test ?
Date: Thu, 14 Nov 2013 18:39:19 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Nov 14, 2013 at 07:45:07PM +0000, David Binderman wrote:
> Hello there,
> 
> I just compiled ncurses-5.9 with extra Linux gcc compiler flag -Wlogical-op

thanks (I hadn't noticed this option).
 
> It said
> 
> ../../progs/infocmp.c:804:6: warning: logical 'and' of mutually exclusive 
> tests is always false [-Wlogical-op]
> 
> Source code is
> 
>         if (strnames[i][0] == 'k' && strnames[i][0] == 'f')
> 
> Suggest swap && for ||

actually the comparison is referring to "kf" as in this section in terminfo(5):

       key_f0                        kf0        k0        F0 function key
       key_f1                        kf1        k1        F1 function key
       key_f10                       kf10       k;        F10 function key
       key_f11                       kf11       F1        F11 function key

and the function is rather old (from 1.9.7a in November 1995 :-)

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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