Skip to content

refactor(thread_pool): drop the -Wmaybe-uninitialized pragma; fix it properly (true-async/server#93)#178

Merged
EdmondDantes merged 1 commit into
mainfrom
93-thread-pool-warning-cleanup
Jul 4, 2026
Merged

refactor(thread_pool): drop the -Wmaybe-uninitialized pragma; fix it properly (true-async/server#93)#178
EdmondDantes merged 1 commit into
mainfrom
93-thread-pool-warning-cleanup

Conversation

@EdmondDantes

Copy link
Copy Markdown
Contributor

Follow-up to #177. That PR silenced GCC -O2 -Wmaybe-uninitialized in thread_pool_worker_handler with a blanket #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" over the whole function — a poor tool: it hides any future real uninitialized-variable bug there. This replaces it with proper, targeted fixes (no pragma, no Zend/ change):

  • volatile on the five loop-locals that live across the loop's zend_try (state, snapshot, worker_coro, task_scope, body_bailed) — the C 7.13.2.1-correct fix for setjmp-live automatics.
  • Split the two inner zend_try blocks (the bootloader call and the body await) into small guarded helpers (thread_pool_call_guarded, thread_pool_suspend_guarded). GCC's misfire on the zend_try macro's own __orig_bailout only happens across nested zend_try; with no nesting it's gone.

Result: zero -O2 warnings in the file, no suppression, no core change. thread_pool suite 78/79 (the one WARN is the pre-existing XFAIL-that-passes), behavior unchanged.

…le the setjmp-live locals + split the nested zend_try blocks into guarded helpers (true-async/server#93)
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@EdmondDantes EdmondDantes merged commit 30430d4 into main Jul 4, 2026
8 of 9 checks passed
@EdmondDantes EdmondDantes deleted the 93-thread-pool-warning-cleanup branch July 4, 2026 13:17
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.

1 participant