AcademySoftwareFoundation / AcademySoftwareFoundation/Imath

MinGW warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]

Open
#273 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
488
Forks
161
Avg merge
1d 3h
Merged PRs (30d)
3

Description

This is with GCC 12.2.0 on [MSYS2 UCRT64](https://github.com/msys2/MINGW-packages/actions/runs/3417550887/jobs/5688814001#step:11:319)/MINGW64/MINGW32:

```
In member function 'constexpr const Imath_3_1::Color4& Imath_3_1::Color4::operator=(const Imath_3_1::Color4&) [with T = unsigned char]',
inlined from 'PyImath::FixedArray2D::FixedArray2D(Py_ssize_t, Py_ssize_t) [with T = Imath_3_1::Color4]' at C:/_/mingw-w64-imath/src/Imath-3.1.6/src/python/PyImath/PyImathFixedArray2D.h:76:45,
inlined from 'PyImath::FixedArray2D PyImath::FixedArray2D::getslice(PyObject*) const [with T = Imath_3_1::Color4]' at C:/_/mingw-w64-imath/src/Imath-3.1.6/src/python/PyImath/PyImathFixedArray2D.h:224:32:
C:/_/mingw-w64-imath/src/Imath-3.1.6/src/Imath/ImathColor.h:512:7: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]
512 | r = v.r;
| ~~^~~~~
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the GCC 12.2 warning on MSYS2 UCRT64/MINGW64/MINGW32, then inspect PyImath/PyImathFixedArray2D.h at lines 76 and 224 and Imath/ImathColor.h around line 512. Compare the compiler's warning path with the relevant constructors and assignment code. Done means the warning is addressed without changing the intended fixed-array or Color4 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.