From d89fa59beda49c0365afc19c2990a2bf935ef369 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 5 Oct 2017 07:23:17 +0100 Subject: [PATCH] Enable and fix -Wunused-variable warnings. --- configure.ac | 4 ++-- src/libespeak-ng/compiledata.c | 2 -- src/libespeak-ng/readclause.c | 1 - src/libespeak-ng/synthdata.c | 2 -- src/libespeak-ng/translate.c | 1 - tests/readclause.c | 1 - 6 files changed, 2 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 273889d8..0619cb3a 100644 --- a/configure.ac +++ b/configure.ac @@ -275,9 +275,9 @@ dnl dnl Reference: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html dnl ================================================================ -AX_CHECK_COMPILE_FLAG([-Wunused-function], [CFLAGS="-Wunused-function $CFLAGS"]) - +AX_CHECK_COMPILE_FLAG([-Wunused-function], [CFLAGS="-Wunused-function $CFLAGS"]) AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [CFLAGS="-Wunused-parameter $CFLAGS"]) +AX_CHECK_COMPILE_FLAG([-Wunused-variable], [CFLAGS="-Wunused-variable $CFLAGS"]) dnl ================================================================ dnl Generate output. diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 213692b7..572961df 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -2359,8 +2359,6 @@ static void WritePhonemeTables() static void EndPhonemeTable() { int ix; - int *pw; - int length; if (n_phoneme_tabs == 0) return; diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index ef8da7d1..39a3f026 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -184,7 +184,6 @@ int Eof(void) static int GetC(void) { int c1; - static int ungot2 = 0; if ((c1 = ungot_char) != 0) { ungot_char = 0; diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c index 9bf47423..2d4f27a1 100644 --- a/src/libespeak-ng/synthdata.c +++ b/src/libespeak-ng/synthdata.c @@ -112,7 +112,6 @@ espeak_ng_STATUS LoadPhData(int *srate, espeak_ng_ERROR_CONTEXT *context) int length = 0; int rate; unsigned char *p; - int *pw; espeak_ng_STATUS status; if ((status = ReadPhFile((void **)&phoneme_tab_data, "phontab", NULL, context)) != ENS_OK) @@ -508,7 +507,6 @@ static bool InterpretCondition(Translator *tr, int control, PHONEME_LIST *plist, unsigned int data; int instn; int instn2; - int count; int check_endtype = 0; PHONEME_TAB *ph; PHONEME_LIST *plist_this; diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index 73cd9948..7ddb49af 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -525,7 +525,6 @@ static int TranslateWord3(Translator *tr, char *word_start, WORD_TAB *wtab, char int more_suffixes; int confirm_prefix; int spell_word; - int stress_bits; int emphasize_allcaps = 0; int wflags; int wmark; diff --git a/tests/readclause.c b/tests/readclause.c index 486c0979..2692ba10 100644 --- a/tests/readclause.c +++ b/tests/readclause.c @@ -41,7 +41,6 @@ static short charix[N_TR_SOURCE+4]; static int charix_top = 0; static int tone2; static char voice_change_name[40]; -static int terminator; static espeak_ng_STATUS set_text(const char *text, const char *voicename)