Skip to content

Build error #2

@ekawahyu

Description

@ekawahyu

Build error from the latest on branch main:

CXX src/startup_stm32f103.cpp  ==>  build/src/startup_stm32f103.o
arm-none-eabi-g++ -DSTM32F103xB -Iinclude -mfloat-abi=soft -mthumb -mcpu=cortex-m3 -Os -fno-exceptions -fno-rtti -nostdlib -fno-tree-loop-distribute-patterns -fdata-sections -ffunction-sections -Wall -Wextra -Wundef -Wshadow -Wredundant-decls -Weffc++ -Werror -o build/src/startup_stm32f103.o -c src/startup_stm32f103.cpp
In file included from /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/c++/13.2.1/algorithm:60,
                 from src/startup_stm32f103.cpp:5:
In static member function 'static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = long unsigned int; _Up = long unsigned int; bool _IsMove = false]',
    inlined from '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = long unsigned int*; _OI = long unsigned int*]' at /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/c++/13.2.1/bits/stl_algobase.h:506:30,
    inlined from '_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = long unsigned int*; _OI = long unsigned int*]' at /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/c++/13.2.1/bits/stl_algobase.h:533:42,
    inlined from '_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = long unsigned int*; _OI = long unsigned int*]' at /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/c++/13.2.1/bits/stl_algobase.h:540:31,
    inlined from '_OI std::copy(_II, _II, _OI) [with _II = long unsigned int*; _OI = long unsigned int*]' at /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/c++/13.2.1/bits/stl_algobase.h:633:7,
    inlined from 'void Reset_Handler()' at src/startup_stm32f103.cpp:192:12:
/Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/c++/13.2.1/bits/stl_algobase.h:437:30: error: 'void* __builtin_memcpy(void*, const void*, unsigned int)' forming offset 4 is out of the bounds [0, 4] of object '_sdata' with type 'uint32_t' {aka 'long unsigned int'} [-Werror=array-bounds=]
  437 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/startup_stm32f103.cpp: In function 'void Reset_Handler()':
src/startup_stm32f103.cpp:13:17: note: '_sdata' declared here
   13 | extern uint32_t _sdata;
      |                 ^~~~~~
cc1plus: all warnings being treated as errors
make: *** [Makefile:93: build/src/startup_stm32f103.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions