SFML / CSFML

Official binding of SFML for C
https://www.sfml-dev.org
Other
342 stars 121 forks source link

Stop leaving variables unused in release builds #277

Closed ChrisThrasher closed 2 weeks ago

ChrisThrasher commented 2 weeks ago

In a Release build, macros like CSFML_CHECK_RETURN expand into nothing more than a cast-to-void which is meant to silence compiler warnings about unused variables.

By declaring a temporary inside the macro argument, we ensure that debug builds behave the same as always but Release builds expand these macros into truly no code thus ensuring these temporary variables are never created in the first place so there is now nothing that we have to cast to void.