Skip to content

Fix MSVC build error from std::array::begin() passed as raw pointer - #2900

Open
ManasBagul23 wants to merge 1 commit into
su2code:masterfrom
ManasBagul23:fix-msvc-array-pointer
Open

ManasBagul23 wants to merge 1 commit into
su2code:masterfrom
ManasBagul23:fix-msvc-array-pointer

Conversation

@ManasBagul23

Copy link
Copy Markdown

addDoubleArrayOption expects a su2double*, but std::array::begin() returns a checked iterator type under the MSVC STL instead of decaying to a pointer as it effectively does with libstdc++. This broke native Windows builds with MSVC. Use .data() instead, which returns a raw pointer on every implementation.

Proposed Changes

Give a brief overview of your contribution here in a few sentences.

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

addDoubleArrayOption expects a su2double*, but std::array::begin()
returns a checked iterator type under the MSVC STL instead of decaying
to a pointer as it effectively does with libstdc++. This broke native
Windows builds with MSVC. Use .data() instead, which returns a raw
pointer on every implementation.
Copilot AI lite review requested due to automatic review settings September 16, 2026 09:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused portability fix has no unresolved review comments.

Pull request overview

Fixes an MSVC build error by passing raw pointers from std::array to configuration option APIs.

Changes:

  • Replaced .begin() with .data() for FLAME_INIT and SPARK_INIT.
  • Preserved behavior while ensuring portable MSVC compatibility.
File summaries
File Description
Common/src/CConfig.cpp Uses portable raw-pointer access for flamelet options.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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