Skip to content

error: writing 32 bytes into a region of size 28 [-Werror=stringop-overflow=] #1428

@PhilipDeegan

Description

@PhilipDeegan

*(output_ptr++) = *(digits_iter++);

src/fptostring.cpp: In function ‘std::string YAML::detail::fp_formatting::FpToString(T, int) [with T = float]’:
src/fptostring.cpp:188:25: error: writing 32 bytes into a region of size 28 [-Werror=stringop-overflow=]
  188 |         *(output_ptr++) = *(digits_iter++);
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from src/fptostring.cpp:4:
/usr/include/c++/15/array:117:55: note: at offset [0, 27] into destination object ‘std::array<char, 28>::_M_elems’ of size 28
  117 |       typename __array_traits<_Tp, _Nm>::_Type        _M_elems;
      |                                                       ^~~~~~~~
src/fptostring.cpp:134:24: note: at offset [1, 28] into destination object ‘output_buffer’ of size 28
  134 |   std::array<char, 28> output_buffer;
      |                        ^~~~~~~~~~~~~
src/fptostring.cpp: In function ‘std::string YAML::detail::fp_formatting::FpToString(T, int) [with T = double]’:
src/fptostring.cpp:188:25: error: writing 32 bytes into a region of size 28 [-Werror=stringop-overflow=]
  188 |         *(output_ptr++) = *(digits_iter++);
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/15/array:117:55: note: at offset [0, 27] into destination object ‘std::array<char, 28>::_M_elems’ of size 28
  117 |       typename __array_traits<_Tp, _Nm>::_Type        _M_elems;
      |                                                       ^~~~~~~~
src/fptostring.cpp:134:24: note: at offset [1, 28] into destination object ‘output_buffer’ of size 28
  134 |   std::array<char, 28> output_buffer;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions