Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fmahebert
Copy link
Contributor

Description

Updates initialization of loop bounds in StructuredColumns_setup to avoid a miscompilation by gcc+OpenMP as described in #323

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

Copy link
Member

@wdeconinck wdeconinck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the very descriptive comment.
This looks good!
For mental verification when idx_t = int

max = std::numeric_limits<int>::max() =  2147483647
min = std::numeric_limits<int>::min() = -2147483648
j_end_    =  max_over_two =  1073741823
j_begin_  = -max_over_two = -1073741823
j_end_ - j_begin_ = -2147483646  // greater than min so no overflows

@wdeconinck wdeconinck merged commit 2ab62d4 into ecmwf:develop Oct 30, 2025
197 of 198 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants