]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
Remove compiler warnings
authorLeo C <erbl259-lmu@yahoo.de>
Thu, 30 May 2019 05:51:05 +0000 (07:51 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Thu, 30 May 2019 14:43:36 +0000 (16:43 +0200)
avr/Makefile
avr/cli_readline.c
avr/cmd_boot.c
avr/cmd_cpu.c
avr/env.c
avr/z180-serv.c
include/spi.h

index eab1d1f6d2adf65b57154a00f3af7a0c175a2e5c..c392e434b3d0145866c64f66a575724d81aefc7f 100644 (file)
@@ -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
index d4c2c9213e78b913007e4abcb76a5ae6348d3854..0ed8f678e146982accb232fdb496c212ef9cdf56 100644 (file)
@@ -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;
 
index dcf834d7532eef4f667ecbcf92ddc653f11c1444..036a041bd07a3d4c70c5fe3f73dedb69532396a9 100644 (file)
@@ -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);
index fd72b21f19408ea92e6137c56dd99c2fccfda63f..e5158fd705c11a2bc7a5ade6674f782552aca8a6 100644 (file)
@@ -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);
 
index 8896004c8effb9729732fe451c01fa842caaab39..671d1c4c9c88a267ca577713d446a32131e9570b 100644 (file)
--- 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;
                }
index cdc6e5e3b9ec22733ab5185e4b39b384bd4ba691..f99a11efc095b812be258f56ad0238e5d5a400cb 100644 (file)
@@ -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'"),
index 463847631113142a6e5d2b512d31e6a7ec50f37a..9dac375f1e4b07d1587591d745415461a64151f7 100644 (file)
@@ -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);
 }