bug-texinfo
[Top][All Lists]
Advanced

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

-Wtype-limits warning in info/infokey.c


From: Patrice Dumas
Subject: -Wtype-limits warning in info/infokey.c
Date: Thu, 10 Oct 2024 12:33:45 +0200

Hello,

I get this warning:
In file included from ../../info/doc.h:59,
                 from ../../info/infokey.c:21:
../../info/infokey.c: In function ‘compile’:
../../info/infomap.h:105:29: warning: comparison is always true due to limited 
range of data type [-Wtype-limits]
  105 | #define KEYMAP_META(k) ((k) < KEYMAP_META_BASE ? (k) + KEYMAP_META_BASE 
: (k))
      |                             ^
../../info/infokey.c:223:44: note: in expansion of macro ‘KEYMAP_META’
  223 |                       seq[slen++] = meta ? KEYMAP_META(c) : (c); \
      |                                            ^~~~~~~~~~~
../../info/infokey.c:380:21: note: in expansion of macro ‘To_seq’
  380 |                     To_seq (oval);
      |                     ^~~~~~


This is in the code that parses keys.  My feeling is that the code is
ok, macros are used to avoid code duplication an some parts are never
needed but it would not be worth it disentangling the different cases,
but I report here in case it could be of use.

-- 
Pat



reply via email to

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