From 24bf7a500ecad7091f92cf9063d0b6cbbf678db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 13 Jan 2016 12:25:09 +0100 Subject: Add -pedantic to debug CFLAGS and fix resulting warnings --- config.def.h | 24 ++++++++++++------------ config.mk | 2 +- text-regex.h | 2 +- view.h | 6 +++++- vis-cmds.c | 2 +- vis-lua.h | 2 +- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/config.def.h b/config.def.h index 1a549cd..918e5ce 100644 --- a/config.def.h +++ b/config.def.h @@ -54,7 +54,7 @@ static KeyBinding basic_movement[] = { { "", ACTION(WINDOW_HALFPAGE_DOWN) }, { "", ACTION(CURSOR_LINE_BEGIN) }, { "", ACTION(CURSOR_LINE_END) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_movements[] = { @@ -116,7 +116,7 @@ static KeyBinding vis_movements[] = { { "?", ACTION(PROMPT_SEARCH_BACKWARD) }, { "`", ACTION(MARK_GOTO) }, { "'", ACTION(MARK_GOTO_LINE) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_textobjs[] = { @@ -160,7 +160,7 @@ static KeyBinding vis_textobjs[] = { { "ie", ACTION(TEXT_OBJECT_ENTIRE_INNER) }, { "if", ACTION(TEXT_OBJECT_FUNCTION_INNER) }, { "il", ACTION(TEXT_OBJECT_LINE_INNER) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_operators[] = { @@ -190,13 +190,13 @@ static KeyBinding vis_operators[] = { { "!", ACTION(OPERATOR_FILTER) }, { "=", ACTION(OPERATOR_FILTER_FMT) }, { "\"", ACTION(REGISTER) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_operator_options[] = { { "v", ACTION(MOTION_CHARWISE) }, { "V", ACTION(MOTION_LINEWISE) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_normal[] = { @@ -268,7 +268,7 @@ static KeyBinding vis_mode_normal[] = { { "m", ACTION(MARK_SET) }, { "", ALIAS(":help") }, { "ga", ACTION(UNICODE_INFO) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_visual[] = { @@ -290,13 +290,13 @@ static KeyBinding vis_mode_visual[] = { { "s", ALIAS("c") }, { "J", ACTION(JOIN_LINES) }, { "o", ACTION(SELECTION_FLIP) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_visual_line[] = { { "v", ACTION(MODE_VISUAL) }, { "V", ACTION(MODE_NORMAL) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_readline[] = { @@ -309,7 +309,7 @@ static KeyBinding vis_mode_readline[] = { { "", ACTION(DELETE_WORD_PREV) }, { "", ACTION(DELETE_LINE_BEGIN) }, { "", ACTION(INSERT_VERBATIM) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_prompt[] = { @@ -318,7 +318,7 @@ static KeyBinding vis_mode_prompt[] = { { "", ACTION(PROMPT_ENTER) }, { "", ALIAS("") }, { "", ACTION(NOP) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_insert[] = { @@ -335,9 +335,9 @@ static KeyBinding vis_mode_insert[] = { { "", ACTION(WINDOW_SLIDE_DOWN) }, { "", ACTION(INSERT_TAB) }, { "", ACTION(INSERT_REGISTER) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_replace[] = { - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; diff --git a/config.mk b/config.mk index 45a4920..7217dda 100644 --- a/config.mk +++ b/config.mk @@ -57,7 +57,7 @@ LDFLAGS_LIBS = $(LDFLAGS_LUA) $(LDFLAGS_TERMKEY) $(LDFLAGS_CURSES) $(LIBS) CFLAGS_VIS = $(CFLAGS_LIBS) -std=c99 -Os -DVERSION=\"${VERSION}\" -DNDEBUG -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DLUA_COMPAT_ALL LDFLAGS_VIS = $(LDFLAGS_LIBS) -DEBUG_CFLAGS_VIS = ${CFLAGS_VIS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter +DEBUG_CFLAGS_VIS = ${CFLAGS_VIS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -pedantic -Wno-missing-field-initializers -Wno-unused-parameter CC ?= cc STRIP ?= strip diff --git a/text-regex.h b/text-regex.h index d304d57..5c85fdd 100644 --- a/text-regex.h +++ b/text-regex.h @@ -12,4 +12,4 @@ void text_regex_free(Regex *r); int text_search_range_forward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags); int text_search_range_backward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags); -#endif \ No newline at end of file +#endif diff --git a/view.h b/view.h index ea8bca6..1f3bae1 100644 --- a/view.h +++ b/view.h @@ -3,6 +3,11 @@ #include #include +#if CONFIG_LUA +#include +#else +typedef struct lua_State lua_State; +#endif #include "register.h" #include "text.h" #include "ui.h" @@ -10,7 +15,6 @@ typedef struct View View; typedef struct Cursor Cursor; typedef struct Selection Selection; -typedef struct lua_State lua_State; typedef struct { int width; /* display width i.e. number of columns ocupied by this character */ diff --git a/vis-cmds.c b/vis-cmds.c index 3a89d2a..f7af52d 100644 --- a/vis-cmds.c +++ b/vis-cmds.c @@ -103,7 +103,7 @@ static Command cmds[] = { { { "earlier" }, cmd_earlier_later, CMD_OPT_NONE }, { { "later" }, cmd_earlier_later, CMD_OPT_NONE }, { { "!", }, cmd_filter, CMD_OPT_NONE }, - { /* array terminator */ }, + { { NULL, }, NULL, CMD_OPT_NONE }, }; diff --git a/vis-lua.h b/vis-lua.h index b0f1293..95cc1e3 100644 --- a/vis-lua.h +++ b/vis-lua.h @@ -19,4 +19,4 @@ void vis_lua_file_close(Vis*, File*); void vis_lua_win_open(Vis*, Win*); void vis_lua_win_close(Vis*, Win*); -#endif \ No newline at end of file +#endif -- cgit v1.2.3