From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (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 7713A445320 for ; Mon, 6 Jul 2020 18:09:38 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id s9so45768955ljm.11 for ; Mon, 06 Jul 2020 08:09:38 -0700 (PDT) Date: Mon, 6 Jul 2020 18:09:35 +0300 From: Cyrill Gorcunov Message-ID: <20200706150935.GN2256@grain> References: <20200703144526.522358-1-gorcunov@gmail.com> <20200704073038.GK2256@grain> <0d0901d65311$f8c7a030$ea56e090$@tarantool.org> <20200705213722.GL2256@grain> <0ef401d6539a$13a1ad00$3ae50700$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ef401d6539a$13a1ad00$3ae50700$@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Timur Safin Cc: 'tml' , 'Vladislav Shpilevoy' , 'Alexander Turenko' On Mon, Jul 06, 2020 at 04:33:46PM +0300, Timur Safin wrote: > : > : IIRC we've been planning to switch to C eventually. > > Please, not - the last time we discussed this question we have specifically > asked to not waste time in this direction. And looks like we agreed on it. I simply gave up because the only arguments "for" C++ was templates and I really doubt that we can't live without them. Another snippet from ++ was that named "guards" which are calling destructors implicitly. I'm pretty sure this is redundant and we can easily use explicit cleanups. Errors class is a special beast but can be addressed as well. > In any case - plans or not is not relevant here, we are discussing current > C++ code which has slightly different guidelines to ANSI C. And this is > a rare case which specifically described in C++ Core Guidelines. We're working not with plain C++ but rather C/C++ mixture. Not taking into consideration the unification preference the functions from ++ code are exported into plain C code and that is a problem having declaration like extern void foo(); is fine for C++ but in C it is gonna be interpreted as being taking arguments and calling it as foo(1) won't cause build time error while it should. Thus rule of thumb for tarantool code is to describe empty args as void ones.