Skip to content

common : add missing <fstream> include in common.h#25220

Open
zhangrunda wants to merge 1 commit into
ggml-org:masterfrom
zhangrunda:fix/common-h-missing-fstream-include
Open

common : add missing <fstream> include in common.h#25220
zhangrunda wants to merge 1 commit into
ggml-org:masterfrom
zhangrunda:fix/common-h-missing-fstream-include

Conversation

@zhangrunda

@zhangrunda zhangrunda commented Jul 2, 2026

Copy link
Copy Markdown

Overview

common/common.h declares fs_open_ifstream() which returns std::ifstream, but the header does not #include <fstream>.
The type was previously available only transitively through other includes.

On stricter toolchains (e.g. GCC trunk on aarch64/Graviton4) that transitive include is not present, so compilation fails with:error: 'ifstream' in namespace 'std' does not name a type

This adds the #include <fstream>, following the include-what-you-use principle.

Additional information

Fixes #25046

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES — used an AI assistant to help diagnose the root cause (transitive-include breakage) and review the fix. The one-line change and all decisions are my own, and I take responsibility for the submitted change.

Signed-off-by: zhangrunda <zhangrunda1234@outlook.com>
@zhangrunda zhangrunda requested a review from a team as a code owner July 2, 2026 05:39
@ggml-gh-bot

ggml-gh-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

Hi @zhangrunda, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • AI-generated content: This project does not accept PRs, descriptions or commit messages that are fully or predominantly AI-generated. If you have used AI to assist you in writing code, please make sure to disclose that explicitly.

Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

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.

Compile bug: ifstream import missing from common.h

1 participant