Skip to content

ESP-IDF v5.4: array-bounds errors in common.cpp #133

@jaylikesbunda

Description

@jaylikesbunda
S:/Espressif/frameworks/esp-idf-v5.4.1/components/hal/esp32c6/include/hal/gpio_ll.h: In function 'void gpio_ll_matrix_out_default(gpio_dev_t*, uint32_t)':
S:/Espressif/frameworks/esp-idf-v5.4.1/components/hal/esp32c6/include/hal/gpio_ll.h:320:5: warning: missing initializer for member 'gpio_func_out_sel_cfg_reg_t::<unnamed struct>::out_inv_sel' [-Wmissing-field-initializers]
  320 |     };
      |     ^
S:/Espressif/frameworks/esp-idf-v5.4.1/components/hal/esp32c6/include/hal/gpio_ll.h:320:5: warning: missing initializer for member 'gpio_func_out_sel_cfg_reg_t::<unnamed struct>::oen_sel' [-Wmissing-field-initializers]
S:/Espressif/frameworks/esp-idf-v5.4.1/components/hal/esp32c6/include/hal/gpio_ll.h:320:5: warning: missing initializer for member 'gpio_func_out_sel_cfg_reg_t::<unnamed struct>::oen_inv_sel' [-Wmissing-field-initializers]
S:/Espressif/frameworks/esp-idf-v5.4.1/components/hal/esp32c6/include/hal/gpio_ll.h:320:5: warning: missing initializer for member 'gpio_func_out_sel_cfg_reg_t::<unnamed struct>::reserved_11' [-Wmissing-field-initializers]
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::spi::init(int, int, int, int, int)':
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:608:7: error: array subscript 0 is outside array bounds of 'volatile uint32_t [0]' [-Werror=array-bounds=]
  608 |       *reg(SPI_USER_REG(spi_port)) = SPI_USR_MOSI | SPI_USR_MISO | SPI_DOUTDIN;  // need SD card access (full duplex setting)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus.exe: note: source object is likely at address zero
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'void lgfx::v1::spi::beginTransaction(int, uint32_t, int)':
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:693:7: error: array subscript 0 is outside array bounds of 'volatile uint32_t [0]' [-Werror=array-bounds=]
  693 |       *reg(SPI_USER_REG(spi_port)) = user;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus.exe: note: source object is likely at address zero
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:697:7: error: array subscript 0 is outside array bounds of 'volatile uint32_t [0]' [-Werror=array-bounds=]
  697 |       *reg(SPI_MISC_REG( spi_port)) = pin;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus.exe: note: source object is likely at address zero
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:699:7: error: array subscript 0 is outside array bounds of 'volatile uint32_t [0]' [-Werror=array-bounds=]
  699 |       *reg(SPI_CLOCK_REG(spi_port)) = clkdiv;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus.exe: note: source object is likely at address zero
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'void lgfx::v1::spi::writeBytes(int, const uint8_t*, size_t)':
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:729:7: error: array subscript 0 is outside array bounds of 'volatile uint32_t [0]' [-Werror=array-bounds=]
  729 |       *reg(SPI_MOSI_DLEN_REG(spi_port)) = (len << 3) - 1;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus.exe: note: source object is likely at address zero
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'void lgfx::v1::spi::readBytes(int, uint8_t*, size_t)':
S:/GhostESP2/Ghost_ESP/components/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:740:7: error: array subscript 0 is outside array bounds of 'volatile uint32_t [0]' [-Werror=array-bounds=]
  740 |       *reg(SPI_MOSI_DLEN_REG(spi_port)) = (len << 3) - 1;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus.exe: note: source object is likely at address zero

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions