This is an automated email from Gerrit.

"Yang sheng <iyysh...@gmail.com>" just uploaded a new patch set to Gerrit, 
which you can find at https://review.openocd.org/c/openocd/+/7138

-- gerrit

commit 748f1074f92b5d8712603ee587a1e90fc790d033
Author: iysheng <iyysh...@gmail.com>
Date:   Sun Aug 21 10:09:23 2022 +0800

    target/xtensa: Fix compile error with gcc 12.1.1
    
    using gcc version 12.1.1 20220522 (Solus) we get:
    error: 'a3' may be used uninitialized [-Werror=maybe-uninitialized]
    error: '%04x' directive writing between 4 and 8 bytes into a region of size 
5 [-Werror=format-overflow=]
    
    Signed-off-by: iysheng <iyysh...@gmail.com>
    Change-Id: I15df14ab1dc28e5919e005196b081cd3e63425b7

diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c
index 455a06a9b8..318d5fd672 100644
--- a/src/flash/nor/stm32f1x.c
+++ b/src/flash/nor/stm32f1x.c
@@ -760,6 +760,10 @@ static int stm32x_get_property_addr(struct target *target, 
struct stm32x_propert
                addr->device_id = 0x40015800;
                addr->flash_size = 0x1FFFF7E0;
                return ERROR_OK;
+       case STAR_MC1_PARTNO: /* MM32F257x devices */
+               addr->device_id = 0x40007080;
+               addr->flash_size = 0x1FFFE920;
+               return ERROR_OK;
        case CORTEX_M_PARTNO_INVALID:
                /* Check for GD32VF103 with RISC-V CPU */
                if (strcmp(target_type_name(target), "riscv") == 0
@@ -869,6 +873,7 @@ static int stm32x_probe(struct flash_bank *bank)
                stm32x_info->can_load_options = true;
                break;
        case 0x410: /* stm32f1x medium-density */
+       case 0x800: /* mm32f2570 */
                page_size = 1024;
                stm32x_info->ppage_size = 4;
                max_flash_size_in_kb = 128;
diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c
index fe0f43882b..c3da86b43d 100644
--- a/src/target/xtensa/xtensa.c
+++ b/src/target/xtensa/xtensa.c
@@ -591,7 +591,7 @@ static int xtensa_write_dirty_registers(struct target 
*target)
        unsigned int reg_list_size = xtensa->core_cache->num_regs;
        bool preserve_a3 = false;
        uint8_t a3_buf[4];
-       xtensa_reg_val_t a3, woe;
+       xtensa_reg_val_t a3 = 0, woe;
 
        LOG_TARGET_DEBUG(target, "start");
 
@@ -2468,7 +2468,7 @@ static int xtensa_build_reg_cache(struct target *target)
                        LOG_TARGET_ERROR(target, "ERROR: Out of memory");
                        goto fail;
                }
-               sprintf((char *)xtensa->empty_regs[i].name, "?0x%04x", i);
+               sprintf((char *)xtensa->empty_regs[i].name, "?0x%04x", i & 
0xffff);
                xtensa->empty_regs[i].size = 32;
                xtensa->empty_regs[i].type = &xtensa_reg_type;
                xtensa->empty_regs[i].value = calloc(1, 4 /*XT_REG_LEN*/);      
/* make Clang Static Analyzer happy */

-- 

Reply via email to