-
Notifications
You must be signed in to change notification settings - Fork 739
Open
Description
Summary
Building with GCC 14.2.1 (Red Hat gcc-toolset-14 on Rocky Linux 8) and -Werror produces a -Wmaybe-uninitialized warning in nanovdb/math/HDDA.h at line 171.
Error
nanovdb/nanovdb/math/HDDA.h:171:28: error: '*(nanovdb::math::Vec3<float>*)((char*)&it + offsetof(fvdb::HDDASegmentIterator<nanovdb::ReadAccessor<nanovdb::ValueOnIndex, 0, 1, 2>, float>,fvdb::HDDASegmentIterator<nanovdb::ReadAccessor<nanovdb::ValueOnIndex, 0, 1, 2>, float>::mHdda.nanovdb::math::HDDA<nanovdb::math::Ray<float>, nanovdb::math::Coord>::mDelta)).nanovdb::math::Vec3<float>::mVec[0]' may be used uninitialized [-Werror=maybe-uninitialized]
171 | mNext[ axis] += mDim * mDelta[axis];
The mDelta member of HDDA is flagged as potentially uninitialized when used in this expression.
Environment
- Compiler: GCC 14.2.1 (gcc-toolset-14 on Rocky Linux 8)
- NanoVDB version: v32.9.1 (commit 0c4c067bd5f23f0c1b05ab224faa0ad89f73a4b9 via CPM)
- Build type: Release (with
-Wall -Werror) - CUDA: NVIDIA nvcc 13.0.88 with GCC 14.2.1 as host compiler (via
-Xcompiler=-Wall,-Werror)
Notes
We have confirmed that conda-forge's GCC 14.2.0 does not trigger this warning on the same code, so it appears specific to the 14.2.1 patch level. -Wmaybe-uninitialized false positives are a known class of GCC issue.
Workaround
We are suppressing with -Wno-maybe-uninitialized in our downstream build system.
Suggested Fix
Consider either:
- Explicitly initializing
mDeltain theHDDAconstructor/init()to silence the warning - Adding a targeted
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"around the affected code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels