From f1e16f884308e8ef720a4ecbcdcc97af97dce4bd Mon Sep 17 00:00:00 2001 From: Leo C Date: Thu, 30 May 2019 07:51:05 +0200 Subject: [PATCH] Remove compiler warnings --- avr/Makefile | 5 +++-- avr/cli_readline.c | 2 +- avr/cmd_boot.c | 1 - avr/cmd_cpu.c | 6 +++--- avr/env.c | 4 ++-- avr/z180-serv.c | 2 +- include/spi.h | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/avr/Makefile b/avr/Makefile index eab1d1f..c392e43 100644 --- a/avr/Makefile +++ b/avr/Makefile @@ -45,9 +45,10 @@ CINCS := -I../include OPT = s CSTANDARD = -std=gnu11 -CDEBUG = +CDEBUG = -g CWARN = -Wall -Wextra -Wstrict-prototypes -Wredundant-decls -CTUNING = -funsigned-char -fshort-enums -funsigned-bitfields -fpack-struct +CTUNING = -fshort-enums -funsigned-bitfields -fpack-struct +#CTUNING += -funsigned-char CTUNING += -mrelax -fno-common CTUNING += -fno-move-loop-invariants CTUNING += -fno-tree-loop-optimize diff --git a/avr/cli_readline.c b/avr/cli_readline.c index d4c2c92..0ed8f67 100644 --- a/avr/cli_readline.c +++ b/avr/cli_readline.c @@ -134,7 +134,7 @@ int vt_parse (void) static vtparse_state_t state = STATE_GROUND; char buf[CHB_SIZE+1]; uint8_t param[2]; - uint8_t i_buf; + uint8_t i_buf = 0; uint8_t i_param; int ch; diff --git a/avr/cmd_boot.c b/avr/cmd_boot.c index dcf834d..036a041 100644 --- a/avr/cmd_boot.c +++ b/avr/cmd_boot.c @@ -100,7 +100,6 @@ command_ret_t do_bootcf(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int a int_fast8_t verbosity = 0; uint8_t default_stages; uint32_t val; - ERRNUM res = ESUCCESS; /* get default values */ memcpy_P(&boot_param, cfboot, sizeof boot_param); diff --git a/avr/cmd_cpu.c b/avr/cmd_cpu.c index fd72b21..e5158fd 100644 --- a/avr/cmd_cpu.c +++ b/avr/cmd_cpu.c @@ -405,7 +405,7 @@ static const FLASH char * const FLASH cpu_strings[] = { command_ret_t do_cpuchk(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc UNUSED, char * const argv[] UNUSED) { - uint_fast8_t cputype; + uint_fast8_t cputype = 0; ERRNUM err = ESUCCESS; uint8_t ram_save[cpuinfo_length]; @@ -490,7 +490,7 @@ command_ret_t do_cpu_test(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int command_ret_t do_bus_test(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc UNUSED, char * const argv[] UNUSED) { - char ch; + int ch; #if 0 int opt; @@ -655,7 +655,7 @@ command_ret_t do_cpu_freq(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int } } while ((Stat & S_IO_0X40) == 0); - uint32_t cpu_freq; + uint32_t cpu_freq = 0; if (!err) cpu_freq = z80_measure_phi(lcycles); diff --git a/avr/env.c b/avr/env.c index 8896004..671d1c4 100644 --- a/avr/env.c +++ b/avr/env.c @@ -716,8 +716,8 @@ command_ret_t do_env_print(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, /* print selected env vars */ while (optind < argc) { - int rc = env_print(argv[optind], mode); - if (rc < 0) { + int len = env_print(argv[optind], mode); + if (len < 0) { printf_P(PSTR("## Error: \"%s\" not defined\n"), argv[optind]); rc = CMD_RET_FAILURE; } diff --git a/avr/z180-serv.c b/avr/z180-serv.c index cdc6e5e..f99a11e 100644 --- a/avr/z180-serv.c +++ b/avr/z180-serv.c @@ -417,7 +417,7 @@ void msg_cpm_result(uint8_t subf, uint8_t rc, int res) msg_xmit(2, subf, sizeof(result_msg), result_msg); if (rc) { -#if GCC_BUG_61443 +#if defined(GCC_BUG_61443) char msg[40]; strncpy_P(msg, rc_messages[rc & 0x7f], sizeof msg -1); drv_debug(END, PSTR(" rc: %.02x/%d, '%s'"), diff --git a/include/spi.h b/include/spi.h index 4638476..9dac375 100644 --- a/include/spi.h +++ b/include/spi.h @@ -32,7 +32,7 @@ #define SPI_OFF() do { SPCR = 0; } while(0) -static inline __attribute__((always_inline)) void spi_wait() { +static inline __attribute__((always_inline)) void spi_wait(void) { loop_until_bit_is_set(SPSR,SPIF); } -- 2.39.2