diff options
author | James McCoy <jamessan@jamessan.com> | 2016-10-09 20:56:51 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2016-10-09 21:13:08 -0400 |
commit | 8fd12805d7cc6d043adfe325a274c2ac7580e0c6 (patch) | |
tree | d8d0ef9b39f545a27b198a2616f706001850ed72 /test/functional/shell/viml_system_spec.lua | |
parent | 4192c411a84098fe64e5022cfed9b4549f9a8c87 (diff) | |
download | rneovim-8fd12805d7cc6d043adfe325a274c2ac7580e0c6.tar.gz rneovim-8fd12805d7cc6d043adfe325a274c2ac7580e0c6.tar.bz2 rneovim-8fd12805d7cc6d043adfe325a274c2ac7580e0c6.zip |
if_cscope: Fix conversion warnings when char defaults to unsigned
../src/nvim/if_cscope.c: In function 'cs_read_prompt':
../src/nvim/if_cscope.c:1771:47: warning: comparison is always true due to limited range of data type [-Wtype-limits]
while ((ch = (char)getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0])
^~
../src/nvim/if_cscope.c:1804:14: warning: comparison is always false due to limited range of data type [-Wtype-limits]
if (ch == EOF) {
^~
../src/nvim/if_cscope.c:1816:14: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion]
ch = EOF;
^~~
../src/nvim/if_cscope.c:1821:12: warning: comparison is always false due to limited range of data type [-Wtype-limits]
if (ch == EOF)
^~
Since EOF is -1, it will be converted to a large unsigned value to
compare with unsigned char and never match. Use an int to store the
return from getc so we can safely compare it and, once known to be
valid, cast it to char when storing it into buf.
Signed-off-by: James McCoy <jamessan@jamessan.com>
Diffstat (limited to 'test/functional/shell/viml_system_spec.lua')
0 files changed, 0 insertions, 0 deletions