Patch 8.2.0541
Problem: Travis CI does not give compiler warnings.
Solution: Add flags for warnings. Fix uncovered problems. (Ozaki Kiichi,
closes #5898)
Files: .travis.yml, ci/config.mk.clang.sed, ci/config.mk.gcc.sed,
ci/config.mk.sed, src/if_perl.xs, src/if_ruby.c,
src/libvterm/t/harness.c
*** ../vim-8.2.0540/.travis.yml 2020-04-02 15:17:28.937496171 +0200
--- .travis.yml 2020-04-11 17:56:07.022470227 +0200
***************
*** 3,9 ****
_anchors:
envs:
- &tiny-nogui
! BUILD=yes TEST=test FEATURES=tiny "CONFOPT='--disable-gui'" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &tiny
BUILD=yes TEST=test FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &small
--- 3,9 ----
_anchors:
envs:
- &tiny-nogui
! BUILD=yes TEST=test FEATURES=tiny CONFOPT="--disable-gui" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &tiny
BUILD=yes TEST=test FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &small
***************
*** 12,21 ****
BUILD=yes TEST=test FEATURES=normal CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &linux-huge
BUILD=yes TEST="scripttests test_libvterm" CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
! "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
- &osx-huge # macOS build
BUILD=yes TEST=test FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
! "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
- &unittests
BUILD=no TEST=unittests CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
- &asan # ASAN build
--- 12,21 ----
BUILD=yes TEST=test FEATURES=normal CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &linux-huge
BUILD=yes TEST="scripttests test_libvterm" CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
! CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
- &osx-huge # macOS build
BUILD=yes TEST=test FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
! CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
- &unittests
BUILD=no TEST=unittests CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
- &asan # ASAN build
***************
*** 124,129 ****
--- 124,133 ----
- echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K"
- |
if [[ "${BUILD}" = "yes" ]]; then
+ # Append various warning flags to CFLAGS.
+ # BSD sed needs backup extension specified.
+ sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/
config.mk
+ sed -i.bak -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/
config.mk
make ${SHADOWOPT} -j${NPROC}
fi
- echo -en "travis_fold:end:build\\r\\033[0K"
***************
*** 215,225 ****
compiler: gcc
env: *linux-huge
after_success: *coverage
- - <<: *linux
- name: unittests+coverage/gcc
- compiler: gcc
- env: *unittests
- after_success: *coverage
- <<: *linux # ASAN
name: huge+asan/gcc
compiler: gcc
--- 219,224 ----
***************
*** 235,240 ****
--- 234,244 ----
- TEST="-C src testgui"
after_success: *coverage
- <<: *linux
+ name: unittests+coverage/gcc
+ compiler: gcc
+ env: *unittests
+ after_success: *coverage
+ - <<: *linux
name: vimtags/gcc
compiler: gcc
env:
*** ../vim-8.2.0540/ci/config.mk.clang.sed 2020-04-11 17:59:31.602019699 +0200
--- ci/config.mk.clang.sed 2020-04-11 17:56:07.022470227 +0200
***************
*** 0 ****
--- 1 ----
+ /^RUBY_CFLAGS\b/s/$/ -Wno-error=unknown-attributes -Wno-error=ignored-attributes/
*** ../vim-8.2.0540/ci/config.mk.gcc.sed 2020-04-11 17:59:31.606019690 +0200
--- ci/config.mk.gcc.sed 2020-04-11 17:56:07.022470227 +0200
***************
*** 0 ****
--- 1 ----
+ /^CFLAGS\b/s/$/ -Wno-error=maybe-uninitialized/
*** ../vim-8.2.0540/ci/config.mk.sed 2020-04-11 17:59:31.610019681 +0200
--- ci/config.mk.sed 2020-04-11 17:56:07.022470227 +0200
***************
*** 0 ****
--- 1,2 ----
+ /^CFLAGS\b/s/$/ -Wall -Wextra -Wshadow -Werror/
+ /^PERL_CFLAGS\b/s/$/ -Wno-error=unused-function/
*** ../vim-8.2.0540/src/if_perl.xs 2020-03-29 20:51:03.081780739 +0200
--- src/if_perl.xs 2020-04-11 17:56:07.022470227 +0200
***************
*** 195,201 ****
# define Perl_croak_xs_usage dll_Perl_croak_xs_usage
# endif
# ifndef PROTO
! # define Perl_croak_nocontext dll_Perl_croak_nocontext
# define Perl_call_argv dll_Perl_call_argv
# define Perl_call_pv dll_Perl_call_pv
# define Perl_eval_sv dll_Perl_eval_sv
--- 195,203 ----
# define Perl_croak_xs_usage dll_Perl_croak_xs_usage
# endif
# ifndef PROTO
! # ifdef PERL_IMPLICIT_CONTEXT
! # define Perl_croak_nocontext dll_Perl_croak_nocontext
! # endif
# define Perl_call_argv dll_Perl_call_argv
# define Perl_call_pv dll_Perl_call_pv
# define Perl_eval_sv dll_Perl_eval_sv
***************
*** 345,351 ****
--- 347,355 ----
__attribute__noreturn__;
# endif
# endif
+ # ifdef PERL_IMPLICIT_CONTEXT
static void (*Perl_croak_nocontext)(const char*, ...) __attribute__noreturn__;
+ # endif
static I32 (*Perl_dowantarray)(pTHX);
static void (*Perl_free_tmps)(pTHX);
static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32);
*** ../vim-8.2.0540/src/if_ruby.c 2020-04-02 18:50:42.423773112 +0200
--- src/if_ruby.c 2020-04-11 17:56:07.022470227 +0200
***************
*** 99,104 ****
--- 99,110 ----
# define rb_ary_detransient rb_ary_detransient_stub
#endif
+ // On macOS pre-installed Ruby defines "SIZEOF_TIME_T" as "SIZEOF_LONG" so it
+ // conflicts with the definition in config.h then causes macro-redifned warning.
+ #ifdef SIZEOF_TIME_T
+ # undef SIZEOF_TIME_T
+ #endif
+
#include <ruby.h>
#if RUBY_VERSION >= 19
# include <ruby/encoding.h>
*** ../vim-8.2.0540/src/libvterm/t/harness.c 2019-12-04 22:09:31.000000000 +0100
--- src/libvterm/t/harness.c 2020-04-11 17:56:07.022470227 +0200
***************
*** 67,73 ****
static int parser_text(const char bytes[], size_t len, void *user)
{
! int i;
printf("text ");
for(i = 0; i < len; i++) {
--- 67,74 ----
static int parser_text(const char bytes[], size_t len, void *user)
{
! size_t i;
! (void)user;
printf("text ");
for(i = 0; i < len; i++) {
***************
*** 83,88 ****
--- 84,90 ----
static int parser_control(unsigned char control, void *user)
{
+ (void)user;
printf("control %02x\n", control);
return 1;
***************
*** 90,96 ****
static int parser_escape(const char bytes[], size_t len, void *user)
{
! int i;
if(bytes[0] >= 0x20 && bytes[0] < 0x30) {
if(len < 2)
--- 92,99 ----
static int parser_escape(const char bytes[], size_t len, void *user)
{
! size_t i;
! (void)user;
if(bytes[0] >= 0x20 && bytes[0] < 0x30) {
if(len < 2)
***************
*** 112,117 ****
--- 115,121 ----
static int parser_csi(const char *leader, const long args[], int argcount, const char *intermed, char command, void *user)
{
int i;
+ (void)user;
printf("csi %02x", command);
if(leader && leader[0]) {
***************
*** 142,148 ****
static int parser_osc(const char *command, size_t cmdlen, void *user)
{
! int i;
printf("osc ");
for(i = 0; i < cmdlen; i++)
printf("%02x", command[i]);
--- 146,154 ----
static int parser_osc(const char *command, size_t cmdlen, void *user)
{
! size_t i;
! (void)user;
!
printf("osc ");
for(i = 0; i < cmdlen; i++)
printf("%02x", command[i]);
***************
*** 153,159 ****
static int parser_dcs(const char *command, size_t cmdlen, void *user)
{
! int i;
printf("dcs ");
for(i = 0; i < cmdlen; i++)
printf("%02x", command[i]);
--- 159,167 ----
static int parser_dcs(const char *command, size_t cmdlen, void *user)
{
! size_t i;
! (void)user;
!
printf("dcs ");
for(i = 0; i < cmdlen; i++)
printf("%02x", command[i]);
***************
*** 178,183 ****
--- 186,192 ----
static VTermPos state_pos;
static int movecursor(VTermPos pos, VTermPos oldpos, int visible, void *user)
{
+ (void)oldpos, (void)visible, (void)user;
state_pos = pos;
if(want_movecursor)
***************
*** 189,194 ****
--- 198,204 ----
static int want_scrollrect = 0;
static int scrollrect(VTermRect rect, int downward, int rightward, void *user)
{
+ (void)user;
if(!want_scrollrect)
return 0;
***************
*** 202,207 ****
--- 212,218 ----
static int want_moverect = 0;
static int moverect(VTermRect dest, VTermRect src, void *user)
{
+ (void)user;
if(!want_moverect)
return 0;
***************
*** 215,220 ****
--- 226,232 ----
static int want_settermprop = 0;
static int settermprop(VTermProp prop, VTermValue *val, void *user)
{
+ (void)user;
VTermValueType type;
if(!want_settermprop)
return 1;
***************
*** 247,252 ****
--- 259,265 ----
static int state_putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
{
int i;
+ (void)user;
if(!want_state_putglyph)
return 1;
***************
*** 268,273 ****
--- 281,287 ----
static int want_state_erase = 0;
static int state_erase(VTermRect rect, int selective, void *user)
{
+ (void)user;
if(!want_state_erase)
return 1;
***************
*** 291,296 ****
--- 305,311 ----
} state_pen;
static int state_setpenattr(VTermAttr attr, VTermValue *val, void *user)
{
+ (void)user;
switch(attr) {
case VTERM_ATTR_BOLD:
state_pen.bold = val->boolean;
***************
*** 329,334 ****
--- 344,350 ----
static int state_setlineinfo(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user)
{
+ (void)row, (void)newinfo, (void)oldinfo, (void)user;
return 1;
}
***************
*** 350,355 ****
--- 366,372 ----
static int want_screen_damage_cells = 0;
static int screen_damage(VTermRect rect, void *user)
{
+ (void)user;
if(!want_screen_damage)
return 1;
***************
*** 404,409 ****
--- 421,427 ----
{
int eol;
int c;
+ (void)user;
if(!want_screen_scrollback)
return 1;
***************
*** 423,428 ****
--- 441,447 ----
static int screen_sb_popline(int cols, VTermScreenCell *cells, void *user)
{
int col;
+ (void)user;
if(!want_screen_scrollback)
return 0;
***************
*** 456,461 ****
--- 475,481 ----
{
char line[1024] = {0};
int flag;
+ (void)argc, (void)argv;
int err;
***************
*** 926,932 ****
outlen = vterm_output_get_buffer_current(vt);
if(outlen > 0) {
! int i;
char outbuff[1024];
vterm_output_read(vt, outbuff, outlen);
--- 946,952 ----
outlen = vterm_output_get_buffer_current(vt);
if(outlen > 0) {
! size_t i;
char outbuff[1024];
vterm_output_read(vt, outbuff, outlen);
*** ../vim-8.2.0540/src/version.c 2020-04-11 17:09:28.324426586 +0200
--- src/version.c 2020-04-11 17:59:39.478002434 +0200
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 541,
/**/
--
JOHN CLEESE PLAYED: SECOND SOLDIER WITH A KEEN INTEREST IN BIRDS, LARGE MAN
WITH DEAD BODY, BLACK KNIGHT, MR NEWT (A VILLAGE
BLACKSMITH INTERESTED IN BURNING WITCHES), A QUITE
EXTRAORDINARILY RUDE FRENCHMAN, TIM THE WIZARD, SIR
LAUNCELOT
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///