1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix compiler warnings and regression test failure (re: fc2d5a60)

src/cmd/ksh93/bltins/test.c:
- Fix the following compiler warnings from clang:
  test.c:554:11: warning: assigning to 'char *' from 'const char []'
  discards qualifiers
  [-Wincompatible-pointer-types-discards-qualifiers]
                                e_msg = e_badop;
                                      ^ ~~~~~~~
  test.c:556:11: warning: assigning to 'char *' from 'const char []'
  discards qualifiers
  [-Wincompatible-pointer-types-discards-qualifiers]
                                e_msg = e_unsupported_op;
                                      ^ ~~~~~~~~~~~~~~~~
  test.c:560:1: warning: control may reach end of non-void function
  [-Wreturn-type]

src/cmd/ksh93/tests/builtins.sh:
- Fix regression test by updating error message text.
This commit is contained in:
Martijn Dekker 2021-03-27 22:30:14 +00:00
parent fc2d5a6019
commit f8de1f111d
2 changed files with 5 additions and 8 deletions

View file

@ -547,16 +547,13 @@ int test_binop(Shell_t *shp,register int op,const char *left,const char *right)
{
/* fallback for operators not supported by the test builtin */
int i=0;
char *e_msg;
while(shtab_testops[i].sh_number && shtab_testops[i].sh_number != op)
i++;
if(op==TEST_END)
e_msg = e_badop;
else
e_msg = e_unsupported_op;
errormsg(SH_DICT,ERROR_exit(2),e_msg,shtab_testops[i].sh_name);
errormsg(SH_DICT, ERROR_exit(2), op==TEST_END ? e_badop : e_unsupported_op, shtab_testops[i].sh_name);
}
}
/* NOTREACHED */
return(0);
}
/*