Skip to content

Fix variable length arrays warning in waves2amr - #1774

Merged
marchdf merged 3 commits into
kynema:mainfrom
marchdf:fix-vla-w2amr
Oct 28, 2025
Merged

Fix variable length arrays warning in waves2amr#1774
marchdf merged 3 commits into
kynema:mainfrom
marchdf:fix-vla-w2amr

Conversation

@marchdf

@marchdf marchdf commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

Summary

We have the following warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]. Basically waves2amr is using variable length arrays (!): basically for 2 variables n0 and n1, it does double out[n0*n1]. Which is fun and cool, but also not great (as in this is valid C99 but not in the C++ standard) A companion PR fixes this (kynema/Waves2AMR#8) but it comes with an API update, this PR.

Don't merge this PR until we've updated the submod here when the other PR is merged.

Pull request type

Please check the type of change introduced:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Checklist

This PR was tested by running:

  • the unit tests
    • on GPU
    • on CPU
  • the regression tests
    • on GPU
    • on CPU

@marchdf
marchdf requested review from jrood-nrel and mbkuhn October 27, 2025 21:19
@marchdf
marchdf marked this pull request as ready for review October 28, 2025 15:58
@marchdf
marchdf enabled auto-merge (squash) October 28, 2025 15:58
@marchdf
marchdf merged commit 41c6f2e into kynema:main Oct 28, 2025
14 checks passed
@marchdf
marchdf deleted the fix-vla-w2amr branch October 28, 2025 17:03
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.

3 participants