On Sat, Feb 17, 2018 at 6:30 AM, Amos Jeffries squid3@treenet.co.nz wrote:
On 17/02/18 22:59, Jeffrey Walton wrote:
On Sat, Feb 17, 2018 at 4:35 AM, Niels Möller wrote:
...
...
It's not right to use assert on expressions with side-effects. Since will break builds with ./configure CFLAGS='-DNDEBUG'.
No asserts, period. They should not get through an audit.
This is the QA code for testing. Asserting that it works correctly and aborting to fail the test ASAP is the whole purpose of these.
My bad, I should have said:
No asserts in production, period
I use them prodigiously during development. Everything is validated with an assert. I usually don't have to debug because the asserts debug for me. My code can't fart or sneeze without me knowing about it.
But production is a different story.... The time for debugging is over...
Jeff