eval: Fix QuickBuild failures

Compiler used by one VM in QuickBuild has found a number of false positives.
Everything is fine on travis.

List of failures:

From [QuickBuild][1], build [7429][2]:

    14:38:19,945 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c: In function ‘assert_bool’:
    14:38:19,945 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c:7551:40: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
    14:38:20,058 WARN  - cc1: all warnings being treated as errors

. This is not making much sense (7551:40 is `!=` in `{SpecialVarValue} !=
({bool}?{SpecialVarValue}:{SpecialVarValue})`), but this error is present.

---

Also fail from [build][3] [4930][4]:

    15:47:00,853 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval/encode.c: In function ‘encode_read_from_list’:
    15:47:00,853 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval/encode.c:258:30: error: conversion to ‘char’ from ‘int’ may alter its value [-Werror=conversion]

, pointing to `:` in `{char} = ({char} == {const} ? {const} : {char})` where
`{const}` is character constant like `'\n'`. I have no idea where exactly it saw
conversion, so simply casted everything to (char).

---

[Build][5] error:

    08:32:03,472 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c: In function ‘tv_equal’:
    08:32:03,472 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c:5077:1: error: control reaches end of non-void function [-Werror=return-type]

---

Build [4949][7]:

    11:28:00,578 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c: In function ‘f_type’:
    11:28:00,578 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c:16085:24: error: ‘n’ may be used uninitialized in this function [-Werror=uninitialized]
    11:28:00,581 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c: In function ‘f_empty’:
    11:28:00,581 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c:8505:24: error: ‘n’ may be used uninitialized in this function [-Werror=uninitialized]

[1]: http://neovim-qb.szakmeister.net/wicket/page?5-1.ILinkListener-content-buildTab-panel-masterStep-body-children-0-step-body-children-2-body-children-3-step-body-children-0-step-body-children-0-step-head-logLink
[2]: http://neovim-qb.szakmeister.net/build/4929
[3]: http://neovim-qb.szakmeister.net/build/4930
[4]: http://neovim-qb.szakmeister.net/wicket/page?1-1.ILinkListener-content-buildTab-panel-masterStep-body-children-0-step-body-children-1-body-children-3-step-body-children-0-step-body-children-0-step-head-logLink
[5]: http://neovim-qb.szakmeister.net/build/4948/step_status
[7]: http://neovim-qb.szakmeister.net/build/4949
This commit is contained in:
ZyX
2016-02-07 00:20:45 +03:00
parent fa26eee85b
commit c27395ddc8
3 changed files with 9 additions and 8 deletions

View File

@@ -5100,6 +5100,7 @@ tv_equal (
}
assert(false);
return false;
}
/*
@@ -7614,9 +7615,10 @@ static void assert_bool(typval_T *argvars, bool is_true)
if ((argvars[0].v_type != VAR_NUMBER ||
(get_tv_number_chk(&argvars[0], &error) == 0) == is_true || error)
&& (argvars[0].v_type != VAR_SPECIAL
|| argvars[0].vval.v_special != (is_true
?kSpecialVarTrue
:kSpecialVarFalse))) {
|| (argvars[0].vval.v_special
!= (SpecialVarValue) (is_true
? kSpecialVarTrue
: kSpecialVarFalse)))) {
prepare_assert_error(&ga);
fill_assert_error(&ga, &argvars[1],
(char_u *)(is_true ? "True" : "False"),
@@ -8535,7 +8537,7 @@ static void f_diff_hlID(typval_T *argvars, typval_T *rettv)
*/
static void f_empty(typval_T *argvars, typval_T *rettv)
{
bool n;
bool n = true;
switch (argvars[0].v_type) {
case VAR_STRING:
@@ -8562,7 +8564,6 @@ static void f_empty(typval_T *argvars, typval_T *rettv)
break;
case VAR_UNKNOWN:
EMSG2(_(e_intern2), "f_empty(UNKNOWN)");
n = true;
break;
}
@@ -16215,7 +16216,7 @@ static void f_trunc(typval_T *argvars, typval_T *rettv)
*/
static void f_type(typval_T *argvars, typval_T *rettv)
{
int n;
int n = -1;
switch (argvars[0].v_type) {
case VAR_NUMBER: n = 0; break;
@@ -16240,7 +16241,6 @@ static void f_type(typval_T *argvars, typval_T *rettv)
}
case VAR_UNKNOWN: {
EMSG2(_(e_intern2), "f_type(UNKNOWN)");
n = -1;
break;
}
}