[Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list

Cyrill Gorcunov gorcunov at gmail.com
Mon Jul 6 18:09:35 MSK 2020


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.


More information about the Tarantool-patches mailing list