Skip to content

[vt, sdf, usd] fix array-bounds warnings on GCC 13#4031

Open
nvidia-jomiller wants to merge 1 commit intoPixarAnimationStudios:devfrom
NVIDIA-Omniverse:dev-array-bounds-warn-gcc
Open

[vt, sdf, usd] fix array-bounds warnings on GCC 13#4031
nvidia-jomiller wants to merge 1 commit intoPixarAnimationStudios:devfrom
NVIDIA-Omniverse:dev-array-bounds-warn-gcc

Conversation

@nvidia-jomiller
Copy link
Copy Markdown
Collaborator

@nvidia-jomiller nvidia-jomiller commented Apr 8, 2026

Description of Change(s)

Three false-positive warning sites caused by GCC 13 losing bound information during aggressive inlining.

  • pxr/base/vt/streamOut.cpp

    • Ensure dimension is less than Vt_ShapeData::NumOtherDims before indexing into shape.otherDims
  • pxr/usd/sdf/schema.cpp

    • Add TF_AXIOM(static_cast<size_t>(level) < std::size(valueTupleDimensions.d)) to the else-if in _AddValuesToValueContext. GCC cannot bound the plain size_t size member but can see std::size(d) == 2.
  • pxr/usd/usd/clip.cpp

    • Add TF_AXIOM(numTimes <= brackingTimes.size()) so GCC can see that numTimes
      is correctly bounded before std::sort

Link to proposal (if applicable)

Fixes Issue(s)

Checklist

@nvidia-jomiller nvidia-jomiller force-pushed the dev-array-bounds-warn-gcc branch from 8a385c8 to 5cfa483 Compare April 9, 2026 16:46
Five false-positive warning sites caused by GCC 13 losing bound
information during aggressive inlining.

pxr/base/vt/streamOut.cpp
  Ensure dimension is less than Vt_ShapeData::NumOtherDims before
  indexing into shape.otherDims

pxr/usd/sdf/schema.cpp
  Add TF_AXIOM(static_cast<size_t>(level) < std::size(valueTupleDimensions.d))
  to the else-if in _AddValuesToValueContext. GCC cannot bound the plain
  size_t size member but can see std::size(d) == 2.

pxr/usd/usd/clip.cpp
  Add TF_AXIOM(numTimes <= brackingTimes.size()) so GCC can see that numTimes
  is correctly bounded before std::sort
@nvidia-jomiller nvidia-jomiller force-pushed the dev-array-bounds-warn-gcc branch from 5cfa483 to 7dac76b Compare April 9, 2026 17:36
@jesschimein
Copy link
Copy Markdown
Collaborator

Filed as internal issue #USD-12073

(This is an automated message. See here for more information.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants