[haiku-commits] Re: haiku: hrev48623 - src/preferences/network

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-commits@xxxxxxxxxxxxx" <haiku-commits@xxxxxxxxxxxxx>
  • Date: Fri, 9 Jan 2015 14:22:15 -0500

On Friday, January 9, 2015, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:

> Am 08/01/2015 um 18:43 schrieb Jérôme Duval:
>
>> 2015-01-08 8:22 GMT+01:00 Adrien Destugues <pulkomandy@xxxxxxxxx>:
>>
>>> The implicit cast from int32 to bool yields the correct result
>>> (B_CONTROL_OFF == 0 casts to false, B_CONTROL_ON == 1 casts to true) and
>>> this doesn't trigger any compiler warning.
>>>
>>
>> This is nonetheless forbidden in the coding guidelines: "Always use
>> boolean conditions, instead of pointer/integer logic". That this
>> doesn't trigger any compiler warning is off my point.
>>
>
> +1
>

If it is allowed by the C++ language spec I'll allow it, otherwise if it
falls under the category of undefined behavior, I won't allow it.

Other related posts: