AcademySoftwareFoundation / AcademySoftwareFoundation/Imath

PyImathFixedVArray: argument 1 value exceeds maximum object size

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

Description

I assume this should be pretty easy to address? It's currently a warning but warnings often become errors in newer versions of gcc.

```
/builddir/build/BUILD/Imath-3.1.8/src/python/PyImath/PyImathFixedVArray.cpp: In member function '__ct_base ':
/builddir/build/BUILD/Imath-3.1.8/src/python/PyImath/PyImathFixedVArray.cpp:101:44: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
101 | boost::shared_array > a(new std::vector[length]);
| ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^
/builddir/build/BUILD/Imath-3.1.8/src/python/PyImath/PyImathFixedVArray.cpp: In member function '__ct_base ':
/builddir/build/BUILD/Imath-3.1.8/src/python/PyImath/PyImathFixedVArray.cpp:117:44: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
117 | boost::shared_array > a(new std::vector[length]);
| ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^
```

Contributor guide

Open the contributing guide

Research direction

Inspect src/python/PyImath/PyImathFixedVArray.cpp at lines 101 and 117, where the reported vector allocation occurs, and reproduce the warning with GCC 13. Done means the affected build no longer emits the argument-1 maximum-object-size warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.