forked from aniani/vim
patch 8.2.0541: Travis CI does not give compiler warnings
Problem: Travis CI does not give compiler warnings. Solution: Add flags for warnings. Fix uncovered problems. (Ozaki Kiichi, closes #5898)
This commit is contained in:
parent
004a6781b3
commit
81ea1dfb97
20
.travis.yml
20
.travis.yml
@ -3,7 +3,7 @@ language: c
|
|||||||
_anchors:
|
_anchors:
|
||||||
envs:
|
envs:
|
||||||
- &tiny-nogui
|
- &tiny-nogui
|
||||||
BUILD=yes TEST=test FEATURES=tiny "CONFOPT='--disable-gui'" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
BUILD=yes TEST=test FEATURES=tiny CONFOPT="--disable-gui" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||||
- &tiny
|
- &tiny
|
||||||
BUILD=yes TEST=test FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
BUILD=yes TEST=test FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||||
- &small
|
- &small
|
||||||
@ -12,10 +12,10 @@ _anchors:
|
|||||||
BUILD=yes TEST=test FEATURES=normal CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
BUILD=yes TEST=test FEATURES=normal CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||||
- &linux-huge
|
- &linux-huge
|
||||||
BUILD=yes TEST="scripttests test_libvterm" CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
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'"
|
CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
|
||||||
- &osx-huge # macOS build
|
- &osx-huge # macOS build
|
||||||
BUILD=yes TEST=test FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
BUILD=yes TEST=test FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
|
CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
|
||||||
- &unittests
|
- &unittests
|
||||||
BUILD=no TEST=unittests CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
|
BUILD=no TEST=unittests CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
|
||||||
- &asan # ASAN build
|
- &asan # ASAN build
|
||||||
@ -124,6 +124,10 @@ script:
|
|||||||
- echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K"
|
- echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K"
|
||||||
- |
|
- |
|
||||||
if [[ "${BUILD}" = "yes" ]]; then
|
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}
|
make ${SHADOWOPT} -j${NPROC}
|
||||||
fi
|
fi
|
||||||
- echo -en "travis_fold:end:build\\r\\033[0K"
|
- echo -en "travis_fold:end:build\\r\\033[0K"
|
||||||
@ -215,11 +219,6 @@ jobs:
|
|||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: *linux-huge
|
env: *linux-huge
|
||||||
after_success: *coverage
|
after_success: *coverage
|
||||||
- <<: *linux
|
|
||||||
name: unittests+coverage/gcc
|
|
||||||
compiler: gcc
|
|
||||||
env: *unittests
|
|
||||||
after_success: *coverage
|
|
||||||
- <<: *linux # ASAN
|
- <<: *linux # ASAN
|
||||||
name: huge+asan/gcc
|
name: huge+asan/gcc
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
@ -234,6 +233,11 @@ jobs:
|
|||||||
- *linux-huge
|
- *linux-huge
|
||||||
- TEST="-C src testgui"
|
- TEST="-C src testgui"
|
||||||
after_success: *coverage
|
after_success: *coverage
|
||||||
|
- <<: *linux
|
||||||
|
name: unittests+coverage/gcc
|
||||||
|
compiler: gcc
|
||||||
|
env: *unittests
|
||||||
|
after_success: *coverage
|
||||||
- <<: *linux
|
- <<: *linux
|
||||||
name: vimtags/gcc
|
name: vimtags/gcc
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
|
1
ci/config.mk.clang.sed
Normal file
1
ci/config.mk.clang.sed
Normal file
@ -0,0 +1 @@
|
|||||||
|
/^RUBY_CFLAGS\b/s/$/ -Wno-error=unknown-attributes -Wno-error=ignored-attributes/
|
1
ci/config.mk.gcc.sed
Normal file
1
ci/config.mk.gcc.sed
Normal file
@ -0,0 +1 @@
|
|||||||
|
/^CFLAGS\b/s/$/ -Wno-error=maybe-uninitialized/
|
2
ci/config.mk.sed
Normal file
2
ci/config.mk.sed
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/^CFLAGS\b/s/$/ -Wall -Wextra -Wshadow -Werror/
|
||||||
|
/^PERL_CFLAGS\b/s/$/ -Wno-error=unused-function/
|
@ -195,7 +195,9 @@ typedef int perl_key;
|
|||||||
# define Perl_croak_xs_usage dll_Perl_croak_xs_usage
|
# define Perl_croak_xs_usage dll_Perl_croak_xs_usage
|
||||||
# endif
|
# endif
|
||||||
# ifndef PROTO
|
# ifndef PROTO
|
||||||
# define Perl_croak_nocontext dll_Perl_croak_nocontext
|
# ifdef PERL_IMPLICIT_CONTEXT
|
||||||
|
# define Perl_croak_nocontext dll_Perl_croak_nocontext
|
||||||
|
# endif
|
||||||
# define Perl_call_argv dll_Perl_call_argv
|
# define Perl_call_argv dll_Perl_call_argv
|
||||||
# define Perl_call_pv dll_Perl_call_pv
|
# define Perl_call_pv dll_Perl_call_pv
|
||||||
# define Perl_eval_sv dll_Perl_eval_sv
|
# define Perl_eval_sv dll_Perl_eval_sv
|
||||||
@ -345,7 +347,9 @@ static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const para
|
|||||||
__attribute__noreturn__;
|
__attribute__noreturn__;
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
# ifdef PERL_IMPLICIT_CONTEXT
|
||||||
static void (*Perl_croak_nocontext)(const char*, ...) __attribute__noreturn__;
|
static void (*Perl_croak_nocontext)(const char*, ...) __attribute__noreturn__;
|
||||||
|
# endif
|
||||||
static I32 (*Perl_dowantarray)(pTHX);
|
static I32 (*Perl_dowantarray)(pTHX);
|
||||||
static void (*Perl_free_tmps)(pTHX);
|
static void (*Perl_free_tmps)(pTHX);
|
||||||
static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32);
|
static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32);
|
||||||
|
@ -99,6 +99,12 @@
|
|||||||
# define rb_ary_detransient rb_ary_detransient_stub
|
# define rb_ary_detransient rb_ary_detransient_stub
|
||||||
#endif
|
#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>
|
#include <ruby.h>
|
||||||
#if RUBY_VERSION >= 19
|
#if RUBY_VERSION >= 19
|
||||||
# include <ruby/encoding.h>
|
# include <ruby/encoding.h>
|
||||||
|
@ -67,7 +67,8 @@ static VTermEncodingInstance encoding;
|
|||||||
|
|
||||||
static int parser_text(const char bytes[], size_t len, void *user)
|
static int parser_text(const char bytes[], size_t len, void *user)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
(void)user;
|
||||||
|
|
||||||
printf("text ");
|
printf("text ");
|
||||||
for(i = 0; i < len; i++) {
|
for(i = 0; i < len; i++) {
|
||||||
@ -83,6 +84,7 @@ static int parser_text(const char bytes[], size_t len, void *user)
|
|||||||
|
|
||||||
static int parser_control(unsigned char control, void *user)
|
static int parser_control(unsigned char control, void *user)
|
||||||
{
|
{
|
||||||
|
(void)user;
|
||||||
printf("control %02x\n", control);
|
printf("control %02x\n", control);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -90,7 +92,8 @@ static int parser_control(unsigned char control, void *user)
|
|||||||
|
|
||||||
static int parser_escape(const char bytes[], size_t len, void *user)
|
static int parser_escape(const char bytes[], size_t len, void *user)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
(void)user;
|
||||||
|
|
||||||
if(bytes[0] >= 0x20 && bytes[0] < 0x30) {
|
if(bytes[0] >= 0x20 && bytes[0] < 0x30) {
|
||||||
if(len < 2)
|
if(len < 2)
|
||||||
@ -112,6 +115,7 @@ static int parser_escape(const char bytes[], size_t len, void *user)
|
|||||||
static int parser_csi(const char *leader, const long args[], int argcount, const char *intermed, char command, void *user)
|
static int parser_csi(const char *leader, const long args[], int argcount, const char *intermed, char command, void *user)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
(void)user;
|
||||||
printf("csi %02x", command);
|
printf("csi %02x", command);
|
||||||
|
|
||||||
if(leader && leader[0]) {
|
if(leader && leader[0]) {
|
||||||
@ -142,7 +146,9 @@ static int parser_csi(const char *leader, const long args[], int argcount, const
|
|||||||
|
|
||||||
static int parser_osc(const char *command, size_t cmdlen, void *user)
|
static int parser_osc(const char *command, size_t cmdlen, void *user)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
(void)user;
|
||||||
|
|
||||||
printf("osc ");
|
printf("osc ");
|
||||||
for(i = 0; i < cmdlen; i++)
|
for(i = 0; i < cmdlen; i++)
|
||||||
printf("%02x", command[i]);
|
printf("%02x", command[i]);
|
||||||
@ -153,7 +159,9 @@ static int parser_osc(const char *command, size_t cmdlen, void *user)
|
|||||||
|
|
||||||
static int parser_dcs(const char *command, size_t cmdlen, void *user)
|
static int parser_dcs(const char *command, size_t cmdlen, void *user)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
(void)user;
|
||||||
|
|
||||||
printf("dcs ");
|
printf("dcs ");
|
||||||
for(i = 0; i < cmdlen; i++)
|
for(i = 0; i < cmdlen; i++)
|
||||||
printf("%02x", command[i]);
|
printf("%02x", command[i]);
|
||||||
@ -178,6 +186,7 @@ static int want_movecursor = 0;
|
|||||||
static VTermPos state_pos;
|
static VTermPos state_pos;
|
||||||
static int movecursor(VTermPos pos, VTermPos oldpos, int visible, void *user)
|
static int movecursor(VTermPos pos, VTermPos oldpos, int visible, void *user)
|
||||||
{
|
{
|
||||||
|
(void)oldpos, (void)visible, (void)user;
|
||||||
state_pos = pos;
|
state_pos = pos;
|
||||||
|
|
||||||
if(want_movecursor)
|
if(want_movecursor)
|
||||||
@ -189,6 +198,7 @@ static int movecursor(VTermPos pos, VTermPos oldpos, int visible, void *user)
|
|||||||
static int want_scrollrect = 0;
|
static int want_scrollrect = 0;
|
||||||
static int scrollrect(VTermRect rect, int downward, int rightward, void *user)
|
static int scrollrect(VTermRect rect, int downward, int rightward, void *user)
|
||||||
{
|
{
|
||||||
|
(void)user;
|
||||||
if(!want_scrollrect)
|
if(!want_scrollrect)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -202,6 +212,7 @@ static int scrollrect(VTermRect rect, int downward, int rightward, void *user)
|
|||||||
static int want_moverect = 0;
|
static int want_moverect = 0;
|
||||||
static int moverect(VTermRect dest, VTermRect src, void *user)
|
static int moverect(VTermRect dest, VTermRect src, void *user)
|
||||||
{
|
{
|
||||||
|
(void)user;
|
||||||
if(!want_moverect)
|
if(!want_moverect)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -215,6 +226,7 @@ static int moverect(VTermRect dest, VTermRect src, void *user)
|
|||||||
static int want_settermprop = 0;
|
static int want_settermprop = 0;
|
||||||
static int settermprop(VTermProp prop, VTermValue *val, void *user)
|
static int settermprop(VTermProp prop, VTermValue *val, void *user)
|
||||||
{
|
{
|
||||||
|
(void)user;
|
||||||
VTermValueType type;
|
VTermValueType type;
|
||||||
if(!want_settermprop)
|
if(!want_settermprop)
|
||||||
return 1;
|
return 1;
|
||||||
@ -247,6 +259,7 @@ static int want_state_putglyph = 0;
|
|||||||
static int state_putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
|
static int state_putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
(void)user;
|
||||||
if(!want_state_putglyph)
|
if(!want_state_putglyph)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@ -268,6 +281,7 @@ static int state_putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
|
|||||||
static int want_state_erase = 0;
|
static int want_state_erase = 0;
|
||||||
static int state_erase(VTermRect rect, int selective, void *user)
|
static int state_erase(VTermRect rect, int selective, void *user)
|
||||||
{
|
{
|
||||||
|
(void)user;
|
||||||
if(!want_state_erase)
|
if(!want_state_erase)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@ -291,6 +305,7 @@ static struct {
|
|||||||
} state_pen;
|
} state_pen;
|
||||||
static int state_setpenattr(VTermAttr attr, VTermValue *val, void *user)
|
static int state_setpenattr(VTermAttr attr, VTermValue *val, void *user)
|
||||||
{
|
{
|
||||||
|
(void)user;
|
||||||
switch(attr) {
|
switch(attr) {
|
||||||
case VTERM_ATTR_BOLD:
|
case VTERM_ATTR_BOLD:
|
||||||
state_pen.bold = val->boolean;
|
state_pen.bold = val->boolean;
|
||||||
@ -329,6 +344,7 @@ static int state_setpenattr(VTermAttr attr, VTermValue *val, void *user)
|
|||||||
|
|
||||||
static int state_setlineinfo(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user)
|
static int state_setlineinfo(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user)
|
||||||
{
|
{
|
||||||
|
(void)row, (void)newinfo, (void)oldinfo, (void)user;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,6 +366,7 @@ static int want_screen_damage = 0;
|
|||||||
static int want_screen_damage_cells = 0;
|
static int want_screen_damage_cells = 0;
|
||||||
static int screen_damage(VTermRect rect, void *user)
|
static int screen_damage(VTermRect rect, void *user)
|
||||||
{
|
{
|
||||||
|
(void)user;
|
||||||
if(!want_screen_damage)
|
if(!want_screen_damage)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@ -404,6 +421,7 @@ static int screen_sb_pushline(int cols, const VTermScreenCell *cells, void *user
|
|||||||
{
|
{
|
||||||
int eol;
|
int eol;
|
||||||
int c;
|
int c;
|
||||||
|
(void)user;
|
||||||
|
|
||||||
if(!want_screen_scrollback)
|
if(!want_screen_scrollback)
|
||||||
return 1;
|
return 1;
|
||||||
@ -423,6 +441,7 @@ static int screen_sb_pushline(int cols, const VTermScreenCell *cells, void *user
|
|||||||
static int screen_sb_popline(int cols, VTermScreenCell *cells, void *user)
|
static int screen_sb_popline(int cols, VTermScreenCell *cells, void *user)
|
||||||
{
|
{
|
||||||
int col;
|
int col;
|
||||||
|
(void)user;
|
||||||
|
|
||||||
if(!want_screen_scrollback)
|
if(!want_screen_scrollback)
|
||||||
return 0;
|
return 0;
|
||||||
@ -456,6 +475,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
char line[1024] = {0};
|
char line[1024] = {0};
|
||||||
int flag;
|
int flag;
|
||||||
|
(void)argc, (void)argv;
|
||||||
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -926,7 +946,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
outlen = vterm_output_get_buffer_current(vt);
|
outlen = vterm_output_get_buffer_current(vt);
|
||||||
if(outlen > 0) {
|
if(outlen > 0) {
|
||||||
int i;
|
size_t i;
|
||||||
char outbuff[1024];
|
char outbuff[1024];
|
||||||
vterm_output_read(vt, outbuff, outlen);
|
vterm_output_read(vt, outbuff, outlen);
|
||||||
|
|
||||||
|
@ -738,6 +738,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
541,
|
||||||
/**/
|
/**/
|
||||||
540,
|
540,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user