Skip to content

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

Merged
ngxson merged 1 commit into
ggml-org:masterfrom
zhangrunda:fix/common-h-missing-fstream-include
Jul 7, 2026
Merged

ngxson merged 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
Contributor

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.

@zhangrunda

Copy link
Copy Markdown
Contributor Author

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.

Thanks for the note. To clarify: this is a one-line change (adding a missing #include <fstream>). I used AI to help confirm the include reasoning; the change and decisions are mine.
Happy to adjust the wording if the disclosure isn't clear enough.

@ggerganov ggerganov added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Jul 7, 2026
@ngxson
ngxson merged commit c1a411f into ggml-org:master Jul 7, 2026
25 checks passed
@zhangrunda
zhangrunda deleted the fix/common-h-missing-fstream-include branch July 9, 2026 02:21
satindergrewal pushed a commit to satindergrewal/llama.cpp that referenced this pull request Aug 12, 2026
Signed-off-by: zhangrunda <zhangrunda1234@outlook.com>
zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 2026
Signed-off-by: zhangrunda <zhangrunda1234@outlook.com>
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
Signed-off-by: zhangrunda <zhangrunda1234@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile bug: ifstream import missing from common.h

3 participants