Skip to content

fix: Remove warnings when using GCC#389

Open
sbstndb wants to merge 5 commits intohpc-maths:mainfrom
sbstndb:remove_warnings
Open

fix: Remove warnings when using GCC#389
sbstndb wants to merge 5 commits intohpc-maths:mainfrom
sbstndb:remove_warnings

Conversation

@sbstndb
Copy link
Contributor

@sbstndb sbstndb commented Oct 6, 2025

Description

  • Fix -Wmaybe-uninitialized by value-initializing iterator coord buffers in LevelCellArray.
  • Wrap OpenMP pragmas with SAMURAI_WITH_OPENMP guards to silence warnings when OpenMP is off.
  • Minor lambda parameter renames to avoid -Wshadow/-Wunused-parameter.

Related issue

Warnings when compiling with GCC

How has this been tested?

Compiled demos --> no more warnings when compiling advection-2d and burgers

Code of Conduct

By submitting this PR, you agree to follow our Code of Conduct

  • I agree to follow this project's Code of Conduct

@gouarin
Copy link
Contributor

gouarin commented Oct 19, 2025

Thanks ! It looks like there are still some warnings if you look at the GCC trace built in the CI. Could you also fix these ?

@gouarin gouarin deleted the branch hpc-maths:main December 10, 2025 09:00
@gouarin gouarin closed this Dec 10, 2025
@gouarin gouarin reopened this Dec 10, 2025
@gouarin gouarin changed the base branch from master to main December 10, 2025 09:18
Initialize coord_type index{} in begin/end/cbegin/cend to avoid GCC
-Wmaybe-uninitialized with xt::xtensor_fixed (xtensor 0.24).

Fixes warnings like:
  xfixed.hpp:334:9: warning: may be used uninitialized [-Wmaybe-uninitialized]
triggered via LevelCellArray::cbegin() constructing const_iterator.
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