From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A948345C304 for ; Fri, 11 Dec 2020 14:38:14 +0300 (MSK) Received: by mail-lf1-f68.google.com with SMTP id l11so12924874lfg.0 for ; Fri, 11 Dec 2020 03:38:14 -0800 (PST) Date: Fri, 11 Dec 2020 14:38:12 +0300 From: Cyrill Gorcunov Message-ID: <20201211113812.GE544004@grain> References: <20201210161832.729439-1-gorcunov@gmail.com> <20201210161832.729439-2-gorcunov@gmail.com> <02c6bfc0-ceb1-c1bc-5d8b-2450dbc082bc@tarantool.org> <20201211100408.GC544004@grain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH v4 1/4] util: introduce strlcpy helper List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko Cc: Mons Anderson , tml , Vladislav Shpilevoy On Fri, Dec 11, 2020 at 02:07:53PM +0300, Serge Petrenko wrote: ... > > > > n.b. You know every time I see `if (x != [0|NULL])` statement > > it driving me nuts: the language standart is pretty clear for > > `if ()` statement and explains how it is evaluated and I always > > wonder who exactly invented this explisit test for non-zero/nil?! > > Now *every* if statement requires 5 additional symbols for simply > > nothing :( I suspect the person who started to use this form > > simply was not aware of the language standart. > > I guess it's more about code readability rather than producing a > correct expression according to the standard. Hardly. I suspect it was due to lack of understanding how code compiles and evaluates, and being nonfamiliar with standarts ;) > > I was also surprised by this rule at first, but got used to it now. > It's all about what you're used to, after all. Yeah, not a big deal, I can live with this style as well and try to follow for sure :)