Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix variable-length-array warning clang18 #5290

Conversation

BeyondEspresso
Copy link
Member

The PR fixes a warning triggered by variable length arrays in Clang 18:

In file included from /ccs/home/adebus/src/picongpu/include/picongpu/plugins/openPMD/openPMDWriter.x.cpp:50:
/ccs/home/adebus/src/picongpu/include/picongpu/../picongpu/plugins/openPMD/WriteSpecies.hpp:429:40: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
  429 |                     uint64_t numRounds[mpiSize];
      |                                        ^~~~~~~
/ccs/home/adebus/src/picongpu/include/picongpu/../picongpu/plugins/openPMD/WriteSpecies.hpp:429:40: note: read of non-const variable 'mpiSize' is not allowed in a constant expression
/ccs/home/adebus/src/picongpu/include/picongpu/../picongpu/plugins/openPMD/WriteSpecies.hpp:342:26: note: declared here
  342 |                 uint64_t mpiSize = gc.getGlobalSize();
      |                          ^

@BeyondEspresso BeyondEspresso force-pushed the topic-fix-vla-warning-clang18 branch from 72475b2 to 49962bc Compare February 21, 2025 07:56
@ikbuibui ikbuibui added the component: plugin in PIConGPU plugin label Feb 21, 2025
@ikbuibui ikbuibui added this to the 0.9.0 / next stable milestone Feb 21, 2025
@ikbuibui ikbuibui merged commit c7163a7 into ComputationalRadiationPhysics:dev Feb 21, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: plugin in PIConGPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants