Skip to content

error: cast increases required alignment of target type in rv32m1.c #51

@telkamp

Description

@telkamp

Building the default branch (zephyr-20220611) using a GCC 10.2.1 on a Raspberry Pi gives me the errors shown below.
Because I don't need the related architecture, It was sufficient for me to commented these lines out.

src/target/rv32m1/rv32m1.c: In function ‘rv32m1_get_core_reg’:
src/target/rv32m1/rv32m1.c:281:36: error: cast increases required alignment of target type [-Werror=cast-align]
  281 |   buf_set_u32(reg->value, 0, 32, *((uint32_t*)target->reg_cache->reg_list[reg->number].value));
      |                                    ^
src/target/rv32m1/rv32m1.c: In function ‘rv32m1_restore_context’:
src/target/rv32m1/rv32m1.c:236:66: error: cast increases required alignment of target type [-Werror=cast-align]
  236 | G_DEBUG("%s: 0x%08x", target->reg_cache->reg_list[i].name, *(uint32_t*)(target->reg_cache->reg_list[i].value));
      |                                                             ^

./src/helper/log.h:126:5: note: in definition of macro ‘LOG_DEBUG’
  126 |     expr); \
      |     ^~

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