Skip to content

atf: fix C23 build errors for D1 (OpenSBI) - #10772

Open
khaliforce wants to merge 1 commit into
armbian:mainfrom
khaliforce:fix-c23-atf
Open

khaliforce wants to merge 1 commit into
armbian:mainfrom
khaliforce:fix-c23-atf

Conversation

@khaliforce

@khaliforce khaliforce commented Sep 20, 2026

Copy link
Copy Markdown

This PR fixes compilation errors on GCC 15 / C23 standard where bool conflicts with int in OpenSBI for D1.

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility when building with modern C23 toolchains by using the standard Boolean type where available.
    • Fixed semihosting Boolean handling to prevent compilation or integration issues across supported build environments.
    • Preserved existing Boolean behavior for older C standards while improving portability across compiler configurations.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: armbian/build/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 2930864e-bfaa-4a2a-b3cd-17755ab52320

📥 Commits

Reviewing files that changed from the base of the PR and between faa8a66 and 94e4b70.

📒 Files selected for processing (2)
  • patch/atf/atf-d1/0001-fix-bool-c23-error.patch
  • patch/atf/atf-d1/0002-fix-semihosting-bool.patch

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The patch adds a C23 guard around OpenSBI’s bool typedef and changes semihosting_enabled to return int.

Changes

C23 boolean compatibility

Layer / File(s) Summary
Boolean type compatibility
include/sbi/sbi_types.h, lib/utils/serial/semihosting.c
The bool typedef is excluded when C23 is active. The semihosting_enabled return type changes from bool to int; its function body is unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing C23 build errors for the D1 OpenSBI target.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size/small PR with less then 50 lines label Sep 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hey @khaliforce! 👋

Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡
Your effort doesn’t just improve Armbian — it benefits the entire community of users and developers.

If you'd like to stay informed about project updates or collaborate more closely with the team,
you can optionally share some personal contact preferences at armbian.com/update-data.
This helps us keep in touch without relying solely on GitHub notifications.

Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀

@github-actions github-actions Bot added 11 Milestone: Fourth quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

11 Milestone: Fourth quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

2 participants