summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2019-05-30 07:51:05 +0200
committerLeo C2019-05-30 16:43:36 +0200
commitf1e16f884308e8ef720a4ecbcdcc97af97dce4bd (patch)
tree84f515ecffb428c305421d329d0182482cf69774
parentbb497e9d2ea1437c570e179e99f024d2bc456d6f (diff)
downloadz180-stamp-f1e16f884308e8ef720a4ecbcdcc97af97dce4bd.zip
Remove compiler warnings
-rw-r--r--avr/Makefile5
-rw-r--r--avr/cli_readline.c2
-rw-r--r--avr/cmd_boot.c1
-rw-r--r--avr/cmd_cpu.c6
-rw-r--r--avr/env.c4
-rw-r--r--avr/z180-serv.c2
-rw-r--r--include/spi.h2
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);
}