Skip to content

Properly declare getNextWakeupUsecs(), even on non-macs - #786

Open
LinqLover wants to merge 2 commits into
OpenSmalltalk:Cogfrom
LinqLover:declare-getNextWakeupUsecs
Open

LinqLover wants to merge 2 commits into
OpenSmalltalk:Cogfrom
LinqLover:declare-getNextWakeupUsecs

Conversation

@LinqLover

Copy link
Copy Markdown
Contributor

This was another bug that clang 14 apparently treated as a warning, but clang 18 treats is as an error.

This was another bug that clang 14 apparently treated as a warning, but clang 18 treats is as an error.
Copilot AI lite review requested due to automatic review settings September 5, 2026 03:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new sq.h declaration uses an empty parameter list (getNextWakeupUsecs()), which is not a strict C prototype and can still trigger Clang -Wstrict-prototypes errors.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR centralizes the declaration of getNextWakeupUsecs into the shared cross-platform header to avoid Clang 18 build failures caused by missing/incorrect function prototypes.

Changes:

  • Removed per-function extern usqLong getNextWakeupUsecs... declarations from multiple Unix/iOS heartbeat-related call sites.
  • Added a getNextWakeupUsecs declaration to platforms/Cross/vm/sq.h so all platforms see a consistent prototype.
File summaries
File Description
platforms/unix/vm/sqUnixITimerTickerHeartbeat.c Removes local getNextWakeupUsecs forward declaration in favor of the shared header.
platforms/unix/vm/sqUnixITimerHeartbeat.c Same: relies on header prototype instead of local extern.
platforms/unix/vm/sqUnixHeartbeat.c Same: removes local extern declaration to use shared header.
platforms/unix/vm-display-X11/sqUnixX11.c Same: removes local extern ... (void) declaration in the X11 display heartbeat path.
platforms/unix/vm-display-null/sqUnixDisplayNull.c Same: removes local extern ... (void) declaration in the null-display path.
platforms/unix/misc/threadValidate/sqUnixHeartbeat.c Same: removes local extern declaration in thread validation build.
platforms/minheadless/unix/sqUnixHeartbeat.c Same: removes local extern declaration in minheadless build.
platforms/iOS/vm/Common/Classes/sqMacV2Time.c Same: removes local extern ... (void) declaration from iOS time code.
platforms/Cross/vm/sq.h Adds a shared declaration for getNextWakeupUsecs (but should be a strict prototype).
Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread platforms/Cross/vm/sq.h
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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