Skip to content

Silence warnings about empty if/else bodies in release builds.#1

Open
hporten wants to merge 1 commit intorobinhouston:masterfrom
hporten:silence
Open

Silence warnings about empty if/else bodies in release builds.#1
hporten wants to merge 1 commit intorobinhouston:masterfrom
hporten:silence

Conversation

@hporten
Copy link
Copy Markdown

@hporten hporten commented Jan 20, 2013

As debug_print expands to nothing unless PADWALKER_DEBUGGING is
set gcc will warn about "suggest braces around empty body in an
‘if’ statement" (same for ´else´) if ´-Wempty-body´ is used.
And that one is implied by ´-W´.

By defining the macro to a no-op statement we provide a
suitable replacement rather than nothing. A common technique
also used for e.g. assert().

As debug_print expands to nothing unless PADWALKER_DEBUGGING is
set gcc will warn about "suggest braces around empty body in an
‘if’ statement" (same for ´else´) if ´-Wempty-body´ is used.
And that one is implied by ´-W´.

By defining the macro to a no-op statement we provide a
suitable replacement rather than nothing. A common technique
also used for e.g. assert().
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