librdkafka
librdkafka copied to clipboard
Avoid unused variable warnings for return values used only in assertions
The return values of many functions are assigned to variables for the sole purpose of using them in assertion conditions, which causes unused variable warnings to be emitted at compile-time when NDEBUG is defined. Use some compiler trickery in the definition of rd_assert() to avoid unused variable warnings when variables in the assertion condition are only used for that purpose, and ensure that assertions whose conditions contain single-use variables use rd_assert() instead of assert().
Rebased on master.
:tada: All Contributor License Agreements have been signed. Ready to merge.
:white_check_mark: chrisnovakovic
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.