|
From: | Paul Vixie |
Subject: | Re: [Nmh-workers] Nmh-commits Digest, Vol 108, Issue 11 |
Date: | Mon, 22 Jan 2018 10:56:16 -0800 |
User-agent: | Postbox 5.0.22 (Windows/20171208) |
Bakul Shah wrote:
fmttest.c: Avoid `++' with bools, silencing compiler warnings.i hate that perfectly reasonable, traditional idioms have to be avoided for this reason.No strong reason to use type bool in the first place. It didn’t show up till c99.
pointers aren't booleans. integers aren't booleans. being able to silently treat either as a boolean has meant that expressions with parenthesis in the wrong place often compile without warnings and then produced unexpected results. bool was invented for a reason and we should be using it everywhere. even if that means we can't say ++.
-- P Vixie
[Prev in Thread] | Current Thread | [Next in Thread] |