Skip to content

Fix -Wempty-body warnings (rtl8192eu) - #3

Merged
iav merged 1 commit into
fix-wmissing-prototypesfrom
fix-wempty-body
Jun 15, 2026
Merged

Fix -Wempty-body warnings (rtl8192eu)#3
iav merged 1 commit into
fix-wmissing-prototypesfrom
fix-wempty-body

Conversation

@iav

@iav iav commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Eliminates all -Wempty-body warnings (x86_64 / v6.12.91 / gcc13): the debug macros RF_DBG, PHYDM_DBG and DBG_COUNTER expand to nothing in their debug-disabled branches, so if (cond) RF_DBG(...); collapses to if (cond) ;. The empty branches get a do {} while (0) body (a bare {} breaks if (...) MACRO(); else ... chains with a dangling else); genuinely empty if bodies are braced.

Staging for Codex before this commit goes onto the missing-prototypes PR (Mange#366). Same fix as the rtl8189es/88x2cs siblings. Verified: empty-body 0, no errors.

RF_DBG, PHYDM_DBG and DBG_COUNTER expand to nothing in their
debug-disabled branches, so call sites like `if (cond) RF_DBG(...);`
collapse to `if (cond) ;` and gcc reports -Wempty-body. Give those
empty branches a `do {} while (0)` body so they stay valid single
statements; a bare `{}` would break `if (...) MACRO(); else ...`
chains (dangling else). Also brace genuinely empty if-bodies.

Assisted-by: Claude:claude-opus-4.8
@iav

iav commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: a3b096bcae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@iav
iav merged commit a3b096b into fix-wmissing-prototypes Jun 15, 2026
@iav
iav deleted the fix-wempty-body branch June 15, 2026 18:18
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