Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list
@ 2020-07-03 14:45 Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 01/22] version: use void for empty args Cyrill Gorcunov
                   ` (23 more replies)
  0 siblings, 24 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Otherwise compiler treats function as accepting va_args making
code complex on binary level. It's been boring and time consuming
task to walk over sources and fixup the snippets but someone has
to do id.

I split changes on per-file basis for easier application.

issue https://github.com/tarantool/tarantool/issues/4718
branch gorcunov/gh-4718-use-void

Cyrill Gorcunov (22):
  version: use void for empty args
  crc32: use void for empty args
  title: use void for empty args
  proc_title: use void for empty args
  systemd: use void for empty args
  main: use void for empty args
  say: use void for empty args
  memory: use void for empty args
  fiber: use void for empty args
  diag: use void for empty args
  coio: use void for empty args
  cbus: use void for empty args
  backtrace: use void for empty args
  call: use void for empty args
  call_id_cache: use void for empty args
  schema: use void for empty args
  sql: use void for empty args
  user: use void for empty args
  session: use void for empty args
  iproto: use void for empty args
  wal: use void for empty args
  box: use void for empty args

 src/box/box.cc               | 12 ++++++------
 src/box/box.h                |  4 ++--
 src/box/coll_id_cache.c      |  4 ++--
 src/box/coll_id_cache.h      |  4 ++--
 src/box/iproto.cc            | 12 ++++++------
 src/box/iproto.h             |  4 ++--
 src/box/schema.cc            |  4 ++--
 src/box/schema.h             |  6 +++---
 src/box/session.cc           |  8 ++++----
 src/box/session.h            | 10 +++++-----
 src/box/sql.c                |  6 +++---
 src/box/sql.h                |  6 +++---
 src/box/sql/build.c          |  2 +-
 src/box/sql_stmt_cache.c     |  4 ++--
 src/box/sql_stmt_cache.h     |  2 +-
 src/box/user.cc              |  6 +++---
 src/box/user.h               |  4 ++--
 src/box/wal.c                |  8 ++++----
 src/box/wal.h                |  8 ++++----
 src/crc32.c                  |  2 +-
 src/crc32.h                  |  2 +-
 src/lib/coll/coll.c          |  4 ++--
 src/lib/coll/coll.h          |  4 ++--
 src/lib/core/backtrace.cc    |  6 +++---
 src/lib/core/backtrace.h     |  4 ++--
 src/lib/core/cbus.c          |  4 ++--
 src/lib/core/cbus.h          |  7 ++-----
 src/lib/core/coio_file.c     |  2 +-
 src/lib/core/coio_file.h     |  2 +-
 src/lib/core/diag.c          |  2 +-
 src/lib/core/diag.h          |  2 +-
 src/lib/core/fiber.c         | 18 +++++++++---------
 src/lib/core/fiber.h         | 18 +++++++++---------
 src/lib/core/fiber_channel.c |  2 +-
 src/lib/core/fiber_channel.h |  2 +-
 src/lib/core/fiber_cond.c    |  2 +-
 src/lib/core/fiber_pool.c    |  4 ++--
 src/lib/core/memory.c        |  4 ++--
 src/lib/core/memory.h        |  4 ++--
 src/lib/core/say.c           |  4 ++--
 src/lib/core/say.h           |  4 ++--
 src/main.cc                  |  8 ++++----
 src/main.h                   |  2 +-
 src/proc_title.c             |  2 +-
 src/proc_title.h             |  2 +-
 src/systemd.c                |  4 ++--
 src/systemd.h                |  4 ++--
 src/title.c                  |  4 ++--
 src/title.h                  |  4 ++--
 src/version.c                |  2 +-
 50 files changed, 123 insertions(+), 126 deletions(-)


base-commit: 4c7d8281502b1a26c59ffc9a87e082e7e8826932
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 01/22] version: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 02/22] crc32: " Cyrill Gorcunov
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/version.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/version.c b/src/version.c
index aa3536351..7d2d038de 100644
--- a/src/version.c
+++ b/src/version.c
@@ -44,7 +44,7 @@ tarantool_version(void)
 }
 
 uint32_t
-tarantool_version_id()
+tarantool_version_id(void)
 {
 	return version_id(PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR,
 			  PACKAGE_VERSION_PATCH);
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 02/22] crc32: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 01/22] version: use void for empty args Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 03/22] title: " Cyrill Gorcunov
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/crc32.c | 2 +-
 src/crc32.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/crc32.c b/src/crc32.c
index ba9dfb105..dc40f3a83 100644
--- a/src/crc32.c
+++ b/src/crc32.c
@@ -40,7 +40,7 @@
 crc32_func crc32_calc = NULL;
 
 void
-crc32_init()
+crc32_init(void)
 {
 #if defined(HAVE_CPUID) && (defined (__x86_64__) || defined (__i386__))
 	crc32_calc = sse42_enabled_cpu() ? &crc32c_hw : &crc32c;
diff --git a/src/crc32.h b/src/crc32.h
index c29e7fbd2..c84505e79 100644
--- a/src/crc32.h
+++ b/src/crc32.h
@@ -45,7 +45,7 @@ typedef uint32_t (*crc32_func)(uint32_t crc, const char *buf, unsigned int len);
  */
 extern crc32_func crc32_calc;
 
-void crc32_init();
+void crc32_init(void);
 
 #if defined(__cplusplus)
 } /* extern "C" */
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 03/22] title: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 01/22] version: use void for empty args Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 02/22] crc32: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 04/22] proc_title: " Cyrill Gorcunov
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/title.c | 4 ++--
 src/title.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/title.c b/src/title.c
index e07ced779..686557c0b 100644
--- a/src/title.c
+++ b/src/title.c
@@ -72,7 +72,7 @@ void title_free(int argc, char **argv)
 	proc_title_free(argc, argv);
 }
 
-const char *title_get()
+const char *title_get(void)
 {
 	return title_buf;
 }
@@ -99,7 +99,7 @@ my_basename(const char *name)
 	return name;
 }
 
-void title_update()
+void title_update(void)
 {
 	if (title_buf == NULL || title_buf_size == 0)
 		return;
diff --git a/src/title.h b/src/title.h
index 8754d8a55..0c8f05542 100644
--- a/src/title.h
+++ b/src/title.h
@@ -76,10 +76,10 @@ char **title_init(int argc, char **argv);
 void title_free(int argc, char **argv);
 
 /** generate and update process title */
-void title_update();
+void title_update(void);
 
 /** query current title */
-const char *title_get();
+const char *title_get(void);
 
 /* parts: invoke title_update() to propagate changes */
 
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 04/22] proc_title: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (2 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 03/22] title: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 05/22] systemd: " Cyrill Gorcunov
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/proc_title.c | 2 +-
 src/proc_title.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/proc_title.c b/src/proc_title.c
index e31f0e562..39587aeb6 100644
--- a/src/proc_title.c
+++ b/src/proc_title.c
@@ -370,7 +370,7 @@ proc_title_set(const char *format, ...)
 }
 
 size_t
-proc_title_max_length()
+proc_title_max_length(void)
 {
 	return ps_buffer_size - ps_sentinel_size;
 }
diff --git a/src/proc_title.h b/src/proc_title.h
index 10dc0b740..23849d95d 100644
--- a/src/proc_title.h
+++ b/src/proc_title.h
@@ -39,7 +39,7 @@ extern "C" {
 char **proc_title_init(int argc, char **argv);
 void proc_title_free(int argc, char **argv);
 CFORMAT(printf, 1, 2) void proc_title_set(const char *format, ...);
-size_t proc_title_max_length();
+size_t proc_title_max_length(void);
 
 #ifdef __cplusplus
 } /* extern "C" */
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 05/22] systemd: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (3 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 04/22] proc_title: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 06/22] main: " Cyrill Gorcunov
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/systemd.c | 4 ++--
 src/systemd.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/systemd.c b/src/systemd.c
index c80259f06..2463a9dc9 100644
--- a/src/systemd.c
+++ b/src/systemd.c
@@ -50,7 +50,7 @@
 static int systemd_fd = -1;
 static const char *sd_unix_path = NULL;
 
-int systemd_init() {
+int systemd_init(void) {
 	sd_unix_path = getenv("NOTIFY_SOCKET");
 	if (sd_unix_path == NULL) {
 		/* Do nothing if the path is not set. */
@@ -104,7 +104,7 @@ int systemd_init() {
 	return -1;
 }
 
-void systemd_free() {
+void systemd_free(void) {
 	if (systemd_fd > 0)
 		close(systemd_fd);
 }
diff --git a/src/systemd.h b/src/systemd.h
index 861a9af35..7319096d6 100644
--- a/src/systemd.h
+++ b/src/systemd.h
@@ -49,13 +49,13 @@ extern "C" {
  * \return  0 on sucess
  */
 int
-systemd_init();
+systemd_init(void);
 
 /**
  * Close connection with systemd daemon
  */
 void
-systemd_free();
+systemd_free(void);
 
 /**
  * Send message to systemd
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 06/22] main: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (4 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 05/22] systemd: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 07/22] say: " Cyrill Gorcunov
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/main.cc | 8 ++++----
 src/main.h  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main.cc b/src/main.cc
index 2c963912f..b3e7e4160 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -311,7 +311,7 @@ signal_free(void)
 
 /** Make sure the child has a default signal disposition. */
 static void
-signal_reset()
+signal_reset(void)
 {
 	for (int i = 0; i < ev_sig_count; i++)
 		ev_signal_stop(loop(), &ev_sigs[i]);
@@ -340,7 +340,7 @@ signal_reset()
 }
 
 static void
-tarantool_atfork()
+tarantool_atfork(void)
 {
 	signal_reset();
 	box_atfork();
@@ -387,7 +387,7 @@ signal_init(void)
 
 /** Run in the background. */
 static void
-daemonize()
+daemonize(void)
 {
 	pid_t pid;
 	int fd;
@@ -439,7 +439,7 @@ daemonize()
 }
 
 extern "C" void
-load_cfg()
+load_cfg(void)
 {
 	const char *work_dir = cfg_gets("work_dir");
 	if (work_dir != NULL && chdir(work_dir) == -1)
diff --git a/src/main.h b/src/main.h
index f509e905b..d06e43d89 100644
--- a/src/main.h
+++ b/src/main.h
@@ -43,7 +43,7 @@ void
 tarantool_exit(int);
 
 void
-load_cfg();
+load_cfg(void);
 
 #if defined(__cplusplus)
 } /* extern "C" */
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 07/22] say: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (5 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 06/22] main: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 08/22] memory: " Cyrill Gorcunov
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/lib/core/say.c | 4 ++--
 src/lib/core/say.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/core/say.c b/src/lib/core/say.c
index b903cb03f..c75e65b58 100644
--- a/src/lib/core/say.c
+++ b/src/lib/core/say.c
@@ -163,7 +163,7 @@ level_to_syslog_priority(int level)
 }
 
 enum say_logger_type
-log_type()
+log_type(void)
 {
 	return log_default->type;
 }
@@ -744,7 +744,7 @@ say_logger_init(const char *init_str, int level, int nonblock,
 }
 
 void
-say_logger_free()
+say_logger_free(void)
 {
 	if (say_logger_initialized())
 		log_destroy(&log_std);
diff --git a/src/lib/core/say.h b/src/lib/core/say.h
index 857145465..fe8251e4c 100644
--- a/src/lib/core/say.h
+++ b/src/lib/core/say.h
@@ -201,7 +201,7 @@ log_say(struct log *log, int level, const char *filename,
  * @retval say_logger_type.
  */
 enum say_logger_type
-log_type();
+log_type(void);
 
 /**
  * Accessors for default logger file descriptor.
@@ -280,7 +280,7 @@ say_logger_initialized(void);
 
 /** Free default logger */
 void
-say_logger_free();
+say_logger_free(void);
 
 /** \cond public */
 typedef void (*sayfunc_t)(int, const char *, int, const char *,
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 08/22] memory: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (6 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 07/22] say: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 09/22] fiber: " Cyrill Gorcunov
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/lib/core/memory.c | 4 ++--
 src/lib/core/memory.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/core/memory.c b/src/lib/core/memory.c
index f236c1887..f92a733b6 100644
--- a/src/lib/core/memory.c
+++ b/src/lib/core/memory.c
@@ -34,7 +34,7 @@
 struct slab_arena runtime;
 
 void
-memory_init()
+memory_init(void)
 {
 	static struct quota runtime_quota;
 	const size_t SLAB_SIZE = 4 * 1024 * 1024;
@@ -47,7 +47,7 @@ memory_init()
 }
 
 void
-memory_free()
+memory_free(void)
 {
 	/*
 	 * If this is called from a fiber != sched, then
diff --git a/src/lib/core/memory.h b/src/lib/core/memory.h
index dd9d351c7..b7a7d8e3f 100644
--- a/src/lib/core/memory.h
+++ b/src/lib/core/memory.h
@@ -46,10 +46,10 @@ extern "C" {
 extern struct slab_arena runtime;
 
 void
-memory_init();
+memory_init(void);
 
 void
-memory_free();
+memory_free(void);
 #if defined(__cplusplus)
 } /* extern "C" */
 #endif /* defined(__cplusplus) */
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 09/22] fiber: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (7 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 08/22] memory: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 10/22] diag: " Cyrill Gorcunov
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/lib/core/fiber.c         | 18 +++++++++---------
 src/lib/core/fiber.h         | 18 +++++++++---------
 src/lib/core/fiber_channel.c |  2 +-
 src/lib/core/fiber_channel.h |  2 +-
 src/lib/core/fiber_cond.c    |  2 +-
 src/lib/core/fiber_pool.c    |  4 ++--
 6 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c
index 5389ce467..483ae3ce1 100644
--- a/src/lib/core/fiber.c
+++ b/src/lib/core/fiber.c
@@ -303,7 +303,7 @@ fiber_attr_create(struct fiber_attr *fiber_attr)
 }
 
 struct fiber_attr *
-fiber_attr_new()
+fiber_attr_new(void)
 {
 	struct fiber_attr *fiber_attr = malloc(sizeof(*fiber_attr));
 	if (fiber_attr == NULL)  {
@@ -432,7 +432,7 @@ fiber_start(struct fiber *callee, ...)
 }
 
 bool
-fiber_checkstack()
+fiber_checkstack(void)
 {
 	return false;
 }
@@ -551,7 +551,7 @@ fiber_set_cancellable(bool yesno)
 }
 
 bool
-fiber_is_cancelled()
+fiber_is_cancelled(void)
 {
 	return fiber()->flags & FIBER_IS_CANCELLED;
 }
@@ -805,7 +805,7 @@ unregister_fid(struct fiber *fiber)
 }
 
 struct fiber *
-fiber_self()
+fiber_self(void)
 {
 	return fiber();
 }
@@ -1316,20 +1316,20 @@ loop_on_iteration_end(ev_loop *loop, ev_prepare *watcher, int revents)
 }
 
 static inline void
-fiber_top_init()
+fiber_top_init(void)
 {
 	ev_prepare_init(&cord()->prepare_event, loop_on_iteration_end);
 	ev_check_init(&cord()->check_event, loop_on_iteration_start);
 }
 
 bool
-fiber_top_is_enabled()
+fiber_top_is_enabled(void)
 {
 	return fiber_top_enabled;
 }
 
 inline void
-fiber_top_enable()
+fiber_top_enable(void)
 {
 	if (!fiber_top_enabled) {
 		ev_prepare_start(cord()->loop, &cord()->prepare_event);
@@ -1348,7 +1348,7 @@ fiber_top_enable()
 }
 
 inline void
-fiber_top_disable()
+fiber_top_disable(void)
 {
 	if (fiber_top_enabled) {
 		ev_prepare_stop(cord()->loop, &cord()->prepare_event);
@@ -1702,7 +1702,7 @@ cord_set_name(const char *name)
 }
 
 bool
-cord_is_main()
+cord_is_main(void)
 {
 	return cord() == &main_cord;
 }
diff --git a/src/lib/core/fiber.h b/src/lib/core/fiber.h
index cd9346a55..fffbe8f8b 100644
--- a/src/lib/core/fiber.h
+++ b/src/lib/core/fiber.h
@@ -179,7 +179,7 @@ struct fiber_attr;
  * will not take ownership.
  */
 API_EXPORT struct fiber_attr *
-fiber_attr_new();
+fiber_attr_new(void);
 
 /**
  * Delete the fiber_attr and free all allocated resources.
@@ -219,7 +219,7 @@ typedef int (*fiber_func)(va_list);
  * Return the current fiber
  */
 API_EXPORT struct fiber *
-fiber_self();
+fiber_self(void);
 
 /**
  * Create a new fiber.
@@ -343,7 +343,7 @@ fiber_sleep(double s);
  * manually).
  */
 API_EXPORT bool
-fiber_is_cancelled();
+fiber_is_cancelled(void);
 
 /**
  * Report loop begin time as double (cheap).
@@ -666,7 +666,7 @@ cord_name(struct cord *cord)
 
 /** True if this cord represents the process main thread. */
 bool
-cord_is_main();
+cord_is_main(void);
 
 void
 fiber_init(int (*fiber_invoke)(fiber_func f, va_list ap));
@@ -689,7 +689,7 @@ fiber_name(struct fiber *f)
 }
 
 bool
-fiber_checkstack();
+fiber_checkstack(void);
 
 /**
  * @brief yield & check for timeout
@@ -699,7 +699,7 @@ bool
 fiber_yield_timeout(ev_tstamp delay);
 
 void
-fiber_destroy_all();
+fiber_destroy_all(struct cord *cord);
 
 void
 fiber_gc(void);
@@ -726,13 +726,13 @@ fiber_stat(fiber_stat_cb cb, void *cb_ctx);
 
 #if ENABLE_FIBER_TOP
 bool
-fiber_top_is_enabled();
+fiber_top_is_enabled(void);
 
 void
-fiber_top_enable();
+fiber_top_enable(void);
 
 void
-fiber_top_disable();
+fiber_top_disable(void);
 #endif /* ENABLE_FIBER_TOP */
 
 /** Useful for C unit tests */
diff --git a/src/lib/core/fiber_channel.c b/src/lib/core/fiber_channel.c
index 4bbff45c5..2ac585648 100644
--- a/src/lib/core/fiber_channel.c
+++ b/src/lib/core/fiber_channel.c
@@ -223,7 +223,7 @@ fiber_channel_delete(struct fiber_channel *ch)
 static __thread struct mempool ipc_value_pool;
 
 struct ipc_value *
-ipc_value_new()
+ipc_value_new(void)
 {
 	if (! mempool_is_initialized(&ipc_value_pool)) {
 		/*
diff --git a/src/lib/core/fiber_channel.h b/src/lib/core/fiber_channel.h
index 0e64e1459..335324dbc 100644
--- a/src/lib/core/fiber_channel.h
+++ b/src/lib/core/fiber_channel.h
@@ -76,7 +76,7 @@ void
 ipc_value_delete(struct ipc_msg *msg);
 
 struct ipc_value *
-ipc_value_new();
+ipc_value_new(void);
 
 
 /**
diff --git a/src/lib/core/fiber_cond.c b/src/lib/core/fiber_cond.c
index 4998d6494..904a350d9 100644
--- a/src/lib/core/fiber_cond.c
+++ b/src/lib/core/fiber_cond.c
@@ -52,7 +52,7 @@ fiber_cond_destroy(struct fiber_cond *c)
 static __thread struct mempool cond_pool;
 
 struct fiber_cond *
-fiber_cond_new()
+fiber_cond_new(void)
 {
 	struct fiber_cond *cond;
 	if (! mempool_is_initialized(&cond_pool)) {
diff --git a/src/lib/core/fiber_pool.c b/src/lib/core/fiber_pool.c
index d40c9bcc3..b980028e4 100644
--- a/src/lib/core/fiber_pool.c
+++ b/src/lib/core/fiber_pool.c
@@ -46,7 +46,7 @@ fiber_pool_f(va_list ap)
 	pool->size++;
 restart:
 	msg = NULL;
-	while (!stailq_empty(output) && !fiber_is_cancelled(fiber())) {
+	while (!stailq_empty(output) && !fiber_is_cancelled()) {
 		 msg = stailq_shift_entry(output, struct cmsg, fifo);
 
 		if (f->caller == &cord->sched && ! stailq_empty(output) &&
@@ -74,7 +74,7 @@ fiber_pool_f(va_list ap)
 		fiber_on_stop(f);
 	}
 	/** Put the current fiber into a fiber cache. */
-	if (!fiber_is_cancelled(fiber()) && (msg != NULL ||
+	if (!fiber_is_cancelled() && (msg != NULL ||
 	    ev_monotonic_now(loop) - last_active_at < pool->idle_timeout)) {
 		if (msg != NULL)
 			last_active_at = ev_monotonic_now(loop);
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 10/22] diag: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (8 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 09/22] fiber: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 11/22] coio: " Cyrill Gorcunov
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/lib/core/diag.c | 2 +-
 src/lib/core/diag.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/core/diag.c b/src/lib/core/diag.c
index bcb0d1f1c..f872be6a7 100644
--- a/src/lib/core/diag.c
+++ b/src/lib/core/diag.c
@@ -129,7 +129,7 @@ error_create(struct error *e,
 }
 
 struct diag *
-diag_get()
+diag_get(void)
 {
 	return &fiber()->diag;
 }
diff --git a/src/lib/core/diag.h b/src/lib/core/diag.h
index f68415f6f..6bf0b139a 100644
--- a/src/lib/core/diag.h
+++ b/src/lib/core/diag.h
@@ -295,7 +295,7 @@ diag_last_error(struct diag *diag)
 }
 
 struct diag *
-diag_get();
+diag_get(void);
 
 NORETURN static inline void
 diag_raise(void)
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 11/22] coio: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (9 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 10/22] diag: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 12/22] cbus: " Cyrill Gorcunov
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/lib/core/coio_file.c | 2 +-
 src/lib/core/coio_file.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/core/coio_file.c b/src/lib/core/coio_file.c
index 0f21380c5..3ec74a549 100644
--- a/src/lib/core/coio_file.c
+++ b/src/lib/core/coio_file.c
@@ -523,7 +523,7 @@ coio_tempdir(char *path, size_t path_len)
 }
 
 int
-coio_sync()
+coio_sync(void)
 {
 	INIT_COEIO_FILE(eio);
 	eio_req *req = eio_sync(0, coio_complete, &eio);
diff --git a/src/lib/core/coio_file.h b/src/lib/core/coio_file.h
index ac7b1aacf..b8886cd16 100644
--- a/src/lib/core/coio_file.h
+++ b/src/lib/core/coio_file.h
@@ -76,7 +76,7 @@ int     coio_link(const char *oldpath, const char *newpath);
 int     coio_symlink(const char *target, const char *linkpath);
 int     coio_readlink(const char *pathname, char *buf, size_t bufsiz);
 
-int     coio_sync();
+int     coio_sync(void);
 int     coio_fsync(int fd);
 int     coio_fdatasync(int fd);
 
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 12/22] cbus: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (10 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 11/22] coio: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 13/22] backtrace: " Cyrill Gorcunov
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

And drop duplicate declaration of cbus_init.

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/lib/core/cbus.c | 4 ++--
 src/lib/core/cbus.h | 7 ++-----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/lib/core/cbus.c b/src/lib/core/cbus.c
index 28164f666..5d91fb948 100644
--- a/src/lib/core/cbus.c
+++ b/src/lib/core/cbus.c
@@ -322,13 +322,13 @@ cpipe_flush_cb(ev_loop *loop, struct ev_async *watcher, int events)
 }
 
 void
-cbus_init()
+cbus_init(void)
 {
 	cbus_create(&cbus);
 }
 
 void
-cbus_free()
+cbus_free(void)
 {
 	cbus_destroy(&cbus);
 }
diff --git a/src/lib/core/cbus.h b/src/lib/core/cbus.h
index f0101cb8b..16ddc571d 100644
--- a/src/lib/core/cbus.h
+++ b/src/lib/core/cbus.h
@@ -244,9 +244,6 @@ cpipe_push(struct cpipe *pipe, struct cmsg *msg)
 		ev_feed_event(pipe->producer, &pipe->flush_input, EV_CUSTOM);
 }
 
-void
-cbus_init();
-
 /**
  * cbus endpoint
  */
@@ -285,11 +282,11 @@ cbus_endpoint_fetch(struct cbus_endpoint *endpoint, struct stailq *output)
 
 /** Initialize the global singleton bus. */
 void
-cbus_init();
+cbus_init(void);
 
 /** Destroy the global singleton bus. */
 void
-cbus_free();
+cbus_free(void);
 
 /**
  * Connect the cord to cbus as a named reciever.
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 13/22] backtrace: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (11 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 12/22] cbus: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 14/22] call: " Cyrill Gorcunov
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/lib/core/backtrace.cc | 6 +++---
 src/lib/core/backtrace.h  | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/lib/core/backtrace.cc b/src/lib/core/backtrace.cc
index 946420885..456ce9a4d 100644
--- a/src/lib/core/backtrace.cc
+++ b/src/lib/core/backtrace.cc
@@ -65,7 +65,7 @@ struct proc_cache_entry {
 };
 
 void
-backtrace_proc_cache_clear()
+backtrace_proc_cache_clear(void)
 {
 	if (proc_cache == NULL)
 		return;
@@ -131,7 +131,7 @@ get_proc_name(unw_cursor_t *unw_cur, unw_word_t *offset, bool skip_cache)
 }
 
 char *
-backtrace()
+backtrace(void)
 {
 	int frame_no = 0;
 	unw_word_t sp = 0, old_sp = 0, ip, offset;
@@ -434,7 +434,7 @@ backtrace_foreach(backtrace_cb cb, coro_context *coro_ctx, void *cb_ctx)
 }
 
 void
-print_backtrace()
+print_backtrace(void)
 {
 	fdprintf(STDERR_FILENO, "%s", backtrace());
 }
diff --git a/src/lib/core/backtrace.h b/src/lib/core/backtrace.h
index ffdc9cd8e..c119d5402 100644
--- a/src/lib/core/backtrace.h
+++ b/src/lib/core/backtrace.h
@@ -40,7 +40,7 @@ extern "C" {
 #ifdef ENABLE_BACKTRACE
 #include <coro.h>
 
-void print_backtrace();
+void print_backtrace(void);
 
 typedef int (backtrace_cb)(int frameno, void *frameret,
                            const char *func, size_t offset, void *cb_ctx);
@@ -50,7 +50,7 @@ void
 backtrace_foreach(backtrace_cb cb, coro_context *coro_ctx, void *cb_ctx);
 
 void
-backtrace_proc_cache_clear();
+backtrace_proc_cache_clear(void);
 
 #endif /* ENABLE_BACKTRACE */
 
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 14/22] call: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (12 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 13/22] backtrace: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 15/22] call_id_cache: " Cyrill Gorcunov
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/lib/coll/coll.c | 4 ++--
 src/lib/coll/coll.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/coll/coll.c b/src/lib/coll/coll.c
index fa27bf34e..ea89971f8 100644
--- a/src/lib/coll/coll.c
+++ b/src/lib/coll/coll.c
@@ -417,7 +417,7 @@ coll_unref(struct coll *coll)
 }
 
 void
-coll_init()
+coll_init(void)
 {
 	UErrorCode err = U_ZERO_ERROR;
 	coll_cache = mh_coll_new();
@@ -429,7 +429,7 @@ coll_init()
 }
 
 void
-coll_free()
+coll_free(void)
 {
 	ucasemap_close(icu_ucase_default_map);
 	ucnv_close(icu_utf8_conv);
diff --git a/src/lib/coll/coll.h b/src/lib/coll/coll.h
index dc343539e..cef80fbe4 100644
--- a/src/lib/coll/coll.h
+++ b/src/lib/coll/coll.h
@@ -123,11 +123,11 @@ coll_unref(struct coll *coll);
 
 /** Initialize collations subsystem. */
 void
-coll_init();
+coll_init(void);
 
 /** Destroy collations subsystem. */
 void
-coll_free();
+coll_free(void);
 
 #if defined(__cplusplus)
 } /* extern "C" */
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 15/22] call_id_cache: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (13 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 14/22] call: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 16/22] schema: " Cyrill Gorcunov
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/coll_id_cache.c | 4 ++--
 src/box/coll_id_cache.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/box/coll_id_cache.c b/src/box/coll_id_cache.c
index 45d295eb9..22673efd0 100644
--- a/src/box/coll_id_cache.c
+++ b/src/box/coll_id_cache.c
@@ -39,7 +39,7 @@ static struct mh_strnptr_t *coll_cache_name = NULL;
 static struct mh_i32ptr_t *coll_id_cache = NULL;
 
 int
-coll_id_cache_init()
+coll_id_cache_init(void)
 {
 	coll_id_cache = mh_i32ptr_new();
 	if (coll_id_cache == NULL) {
@@ -58,7 +58,7 @@ coll_id_cache_init()
 }
 
 void
-coll_id_cache_destroy()
+coll_id_cache_destroy(void)
 {
 	mh_strnptr_delete(coll_cache_name);
 	mh_i32ptr_delete(coll_id_cache);
diff --git a/src/box/coll_id_cache.h b/src/box/coll_id_cache.h
index e3115ddb5..b959b2eb3 100644
--- a/src/box/coll_id_cache.h
+++ b/src/box/coll_id_cache.h
@@ -43,11 +43,11 @@ struct coll_id;
  * @return - 0 on success, -1 on memory error.
  */
 int
-coll_id_cache_init();
+coll_id_cache_init(void);
 
 /** Delete global hash tables. */
 void
-coll_id_cache_destroy();
+coll_id_cache_destroy(void);
 
 /**
  * Insert or replace a collation into collation cache.
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 16/22] schema: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (14 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 15/22] call_id_cache: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 17/22] sql: " Cyrill Gorcunov
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/schema.cc | 4 ++--
 src/box/schema.h  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/box/schema.cc b/src/box/schema.cc
index 456eef429..60e4a7f9c 100644
--- a/src/box/schema.cc
+++ b/src/box/schema.cc
@@ -107,7 +107,7 @@ space_by_name(const char *name)
 
 /** Return current schema version */
 uint32_t
-box_schema_version()
+box_schema_version(void)
 {
 	return schema_version;
 }
@@ -360,7 +360,7 @@ schema_find_id(uint32_t system_space_id, uint32_t index_id,
  * will get altered automatically to their actual format.
  */
 void
-schema_init()
+schema_init(void)
 {
 	struct key_part_def key_parts[3];
 	for (uint32_t i = 0; i < lengthof(key_parts); i++)
diff --git a/src/box/schema.h b/src/box/schema.h
index 7802941ef..25ac6f110 100644
--- a/src/box/schema.h
+++ b/src/box/schema.h
@@ -66,7 +66,7 @@ struct space *
 space_by_name(const char *name);
 
 uint32_t
-box_schema_version();
+box_schema_version(void);
 
 static inline struct space *
 space_cache_find(uint32_t id)
@@ -164,10 +164,10 @@ void
 space_cache_replace(struct space *old_space, struct space *new_space);
 
 void
-schema_init();
+schema_init(void);
 
 void
-schema_free();
+schema_free(void);
 
 struct space *schema_space(uint32_t id);
 
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 17/22] sql: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (15 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 16/22] schema: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 18/22] user: " Cyrill Gorcunov
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/sql.c            | 6 +++---
 src/box/sql.h            | 6 +++---
 src/box/sql/build.c      | 2 +-
 src/box/sql_stmt_cache.c | 4 ++--
 src/box/sql_stmt_cache.h | 2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/box/sql.c b/src/box/sql.c
index 555fcfd1f..000246ee9 100644
--- a/src/box/sql.c
+++ b/src/box/sql.c
@@ -64,7 +64,7 @@ static const uint32_t default_sql_flags = SQL_EnableTrigger
 					  | SQL_RecTriggers;
 
 void
-sql_init()
+sql_init(void)
 {
 	default_flags |= default_sql_flags;
 
@@ -79,7 +79,7 @@ sql_init()
 }
 
 void
-sql_load_schema()
+sql_load_schema(void)
 {
 	assert(db->init.busy == 0);
 	struct space *stat = space_by_name("_sql_stat1");
@@ -97,7 +97,7 @@ sql_load_schema()
 }
 
 sql *
-sql_get()
+sql_get(void)
 {
 	return db;
 }
diff --git a/src/box/sql.h b/src/box/sql.h
index 0fa52fc0b..f56f7a1f1 100644
--- a/src/box/sql.h
+++ b/src/box/sql.h
@@ -39,7 +39,7 @@ extern "C" {
 #endif
 
 void
-sql_init();
+sql_init(void);
 
 /**
  * Initialize SQL statistic system.
@@ -47,7 +47,7 @@ sql_init();
  * Currently unused.
  */
 void
-sql_load_schema();
+sql_load_schema(void);
 
 /**
  * struct sql *
@@ -62,7 +62,7 @@ sql_load_schema();
  * @retval SQL handle.
  */
 struct sql *
-sql_get();
+sql_get(void);
 
 struct Expr;
 struct Parse;
diff --git a/src/box/sql/build.c b/src/box/sql/build.c
index 714fbfbab..8f6b403b9 100644
--- a/src/box/sql/build.c
+++ b/src/box/sql/build.c
@@ -3496,7 +3496,7 @@ sql_session_setting_set(int id, const char *mp_value)
 }
 
 void
-sql_session_settings_init()
+sql_session_settings_init(void)
 {
 	for (int i = 0, id = SESSION_SETTING_SQL_BEGIN;
 	     id < SESSION_SETTING_SQL_END; ++id, ++i) {
diff --git a/src/box/sql_stmt_cache.c b/src/box/sql_stmt_cache.c
index 5e2fb3def..66f7a7f8a 100644
--- a/src/box/sql_stmt_cache.c
+++ b/src/box/sql_stmt_cache.c
@@ -39,7 +39,7 @@
 static struct sql_stmt_cache sql_stmt_cache;
 
 void
-sql_stmt_cache_init()
+sql_stmt_cache_init(void)
 {
 	sql_stmt_cache.hash = mh_i32ptr_new();
 	if (sql_stmt_cache.hash == NULL)
@@ -119,7 +119,7 @@ stmt_cache_find_entry(uint32_t stmt_id)
 }
 
 static void
-sql_stmt_cache_gc()
+sql_stmt_cache_gc(void)
 {
 	struct stmt_cache_entry *entry, *next;
 	rlist_foreach_entry_safe(entry, &sql_stmt_cache.gc_queue, link, next)
diff --git a/src/box/sql_stmt_cache.h b/src/box/sql_stmt_cache.h
index 468cbc9a0..aab6b56b3 100644
--- a/src/box/sql_stmt_cache.h
+++ b/src/box/sql_stmt_cache.h
@@ -89,7 +89,7 @@ struct sql_stmt_cache {
  * during database setup (in sql_init()).
  */
 void
-sql_stmt_cache_init();
+sql_stmt_cache_init(void);
 
 /**
  * Store statistics concerning cache (current size and number
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 18/22] user: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (16 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 17/22] sql: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 19/22] session: " Cyrill Gorcunov
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/user.cc | 6 +++---
 src/box/user.h  | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/box/user.cc b/src/box/user.cc
index 198bf828b..5042fb16f 100644
--- a/src/box/user.cc
+++ b/src/box/user.cc
@@ -414,7 +414,7 @@ static int min_token_idx = 0;
  * is reached (and we're out of tokens).
  */
 uint8_t
-auth_token_get()
+auth_token_get(void)
 {
 	uint8_t bit_no = 0;
 	while (min_token_idx < USER_MAP_SIZE) {
@@ -542,7 +542,7 @@ user_find_by_name(const char *name, uint32_t len)
 }
 
 void
-user_cache_init()
+user_cache_init(void)
 {
 	/** Mark all tokens as unused. */
 	memset(tokens, 0xFF, sizeof(tokens));
@@ -606,7 +606,7 @@ user_cache_init()
 }
 
 void
-user_cache_free()
+user_cache_free(void)
 {
 	if (user_registry)
 		mh_i32ptr_delete(user_registry);
diff --git a/src/box/user.h b/src/box/user.h
index ccfc59346..9ed52c4c7 100644
--- a/src/box/user.h
+++ b/src/box/user.h
@@ -192,11 +192,11 @@ user_find_by_name_xc(const char *name, uint32_t len)
 
 /** Initialize the user cache and access control subsystem. */
 void
-user_cache_init();
+user_cache_init(void);
 
 /** Cleanup the user cache and access control subsystem */
 void
-user_cache_free();
+user_cache_free(void);
 
 /* {{{ Roles */
 
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 19/22] session: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (17 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 18/22] user: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 20/22] iproto: " Cyrill Gorcunov
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/session.cc |  8 ++++----
 src/box/session.h  | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/box/session.cc b/src/box/session.cc
index 7085cc393..7ba7235fe 100644
--- a/src/box/session.cc
+++ b/src/box/session.cc
@@ -72,7 +72,7 @@ RLIST_HEAD(session_on_disconnect);
 RLIST_HEAD(session_on_auth);
 
 static inline uint64_t
-sid_max()
+sid_max(void)
 {
 	static uint64_t sid_max = 0;
 	/* Return the next sid rolling over the reserved value of 0. */
@@ -160,7 +160,7 @@ session_create(enum session_type type)
 }
 
 struct session *
-session_create_on_demand()
+session_create_on_demand(void)
 {
 	assert(fiber_get_session(fiber()) == NULL);
 
@@ -278,7 +278,7 @@ extern "C" void
 session_settings_init(void);
 
 void
-session_init()
+session_init(void)
 {
 	session_registry = mh_i64ptr_new();
 	if (session_registry == NULL)
@@ -289,7 +289,7 @@ session_init()
 }
 
 void
-session_free()
+session_free(void)
 {
 	if (session_registry)
 		mh_i64ptr_delete(session_registry);
diff --git a/src/box/session.h b/src/box/session.h
index a15434f96..833a457bd 100644
--- a/src/box/session.h
+++ b/src/box/session.h
@@ -46,10 +46,10 @@ struct port;
 struct session_vtab;
 
 void
-session_init();
+session_init(void);
 
 void
-session_free();
+session_free(void);
 
 enum session_type {
 	SESSION_TYPE_BACKGROUND = 0,
@@ -221,7 +221,7 @@ extern struct credentials admin_credentials;
  * trigger to destroy it when this fiber ends.
  */
 struct session *
-session_create_on_demand();
+session_create_on_demand(void);
 
 /*
  * When creating a new fiber, the database (box)
@@ -234,7 +234,7 @@ session_create_on_demand();
  * and create it otherwise.
  */
 static inline struct session *
-current_session()
+current_session(void)
 {
 	struct session *session = fiber_get_session(fiber());
 	if (session == NULL) {
@@ -252,7 +252,7 @@ current_session()
  * user on demand as in current_session() applies.
  */
 static inline struct credentials *
-effective_user()
+effective_user(void)
 {
 	struct fiber *f = fiber();
 	struct credentials *u = f->storage.credentials;
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 20/22] iproto: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (18 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 19/22] session: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 21/22] wal: " Cyrill Gorcunov
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/iproto.cc | 12 ++++++------
 src/box/iproto.h  |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/box/iproto.cc b/src/box/iproto.cc
index 51fe7d93b..b8f65e5ec 100644
--- a/src/box/iproto.cc
+++ b/src/box/iproto.cc
@@ -243,7 +243,7 @@ iproto_msg_new(struct iproto_connection *con);
  * Resume stopped connections, if any.
  */
 static void
-iproto_resume();
+iproto_resume(void);
 
 static void
 iproto_msg_decode(struct iproto_msg *msg, const char **pos, const char *reqend,
@@ -544,7 +544,7 @@ static RLIST_HEAD(stopped_connections);
  * in the message pool.
  */
 static inline bool
-iproto_check_msg_max()
+iproto_check_msg_max(void)
 {
 	size_t request_count = mempool_count(&iproto_msg_pool);
 	return request_count > (size_t) iproto_msg_max;
@@ -932,7 +932,7 @@ iproto_connection_resume(struct iproto_connection *con)
  * necessary to use up the limit.
  */
 static void
-iproto_resume()
+iproto_resume(void)
 {
 	while (!iproto_check_msg_max() && !rlist_empty(&stopped_connections)) {
 		/*
@@ -1516,7 +1516,7 @@ tx_reply_iproto_error(struct cmsg *m)
 
 /** Inject a short delay on tx request processing for testing. */
 static inline void
-tx_inject_delay()
+tx_inject_delay(void)
 {
 	ERROR_INJECT(ERRINJ_IPROTO_TX_DELAY, {
 		if (rand() % 100 < 10)
@@ -2185,7 +2185,7 @@ iproto_session_push(struct session *session, struct port *port)
 
 /** Initialize the iproto subsystem and start network io thread */
 void
-iproto_init()
+iproto_init(void)
 {
 	slab_cache_create(&net_slabc, &runtime);
 
@@ -2334,7 +2334,7 @@ iproto_set_msg_max(int new_iproto_msg_max)
 }
 
 void
-iproto_free()
+iproto_free(void)
 {
 	tt_pthread_cancel(net_cord.id);
 	tt_pthread_join(net_cord.id, NULL);
diff --git a/src/box/iproto.h b/src/box/iproto.h
index 1442e68d3..392e4f08e 100644
--- a/src/box/iproto.h
+++ b/src/box/iproto.h
@@ -91,7 +91,7 @@ iproto_bound_address(void);
 } /* extern "C" */
 
 void
-iproto_init();
+iproto_init(void);
 
 void
 iproto_listen(const char *uri);
@@ -100,7 +100,7 @@ void
 iproto_set_msg_max(int iproto_msg_max);
 
 void
-iproto_free();
+iproto_free(void);
 
 #endif /* defined(__cplusplus) */
 
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 21/22] wal: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (19 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 20/22] iproto: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 22/22] box: " Cyrill Gorcunov
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/wal.c | 8 ++++----
 src/box/wal.h | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/box/wal.c b/src/box/wal.c
index 74cc74684..27f9b942d 100644
--- a/src/box/wal.c
+++ b/src/box/wal.c
@@ -196,7 +196,7 @@ static struct vy_log_writer vy_log_writer;
 static struct wal_writer wal_writer_singleton;
 
 enum wal_mode
-wal_mode()
+wal_mode(void)
 {
 	return wal_writer_singleton.wal_mode;
 }
@@ -1296,7 +1296,7 @@ wal_write_none(struct journal *journal, struct journal_entry *entry)
 }
 
 void
-wal_init_vy_log()
+wal_init_vy_log(void)
 {
 	xlog_clear(&vy_log_writer.xlog);
 }
@@ -1351,7 +1351,7 @@ wal_rotate_vy_log_f(struct cbus_call_msg *msg)
 }
 
 void
-wal_rotate_vy_log()
+wal_rotate_vy_log(void)
 {
 	struct wal_writer *writer = &wal_writer_singleton;
 	struct cbus_call_msg msg;
@@ -1491,7 +1491,7 @@ wal_notify_watchers(struct wal_writer *writer, unsigned events)
  * a second EOF marker to an open file.
  */
 void
-wal_atfork()
+wal_atfork(void)
 {
 	if (xlog_is_open(&wal_writer_singleton.current_wal))
 		xlog_atfork(&wal_writer_singleton.current_wal);
diff --git a/src/box/wal.h b/src/box/wal.h
index 11a66a20a..f348dc636 100644
--- a/src/box/wal.h
+++ b/src/box/wal.h
@@ -174,10 +174,10 @@ wal_clear_watcher(struct wal_watcher *watcher,
 		  void (*process_cb)(struct cbus_endpoint *));
 
 void
-wal_atfork();
+wal_atfork(void);
 
 enum wal_mode
-wal_mode();
+wal_mode(void);
 
 /**
  * Wait until all submitted writes are successfully flushed
@@ -238,7 +238,7 @@ void
 wal_collect_garbage(const struct vclock *vclock);
 
 void
-wal_init_vy_log();
+wal_init_vy_log(void);
 
 /**
  * Write xrows to the vinyl metadata log.
@@ -250,7 +250,7 @@ wal_write_vy_log(struct journal_entry *req);
  * Rotate the vinyl metadata log.
  */
 void
-wal_rotate_vy_log();
+wal_rotate_vy_log(void);
 
 #if defined(__cplusplus)
 } /* extern "C" */
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Tarantool-patches] [PATCH 22/22] box: use void for empty args
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (20 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 21/22] wal: " Cyrill Gorcunov
@ 2020-07-03 14:45 ` Cyrill Gorcunov
  2020-07-03 21:23 ` [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Vladislav Shpilevoy
  2020-07-08 12:55 ` Kirill Yukhin
  23 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-03 14:45 UTC (permalink / raw)
  To: tml; +Cc: Alexander Turenko

Fixes #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/box.cc | 12 ++++++------
 src/box/box.h  |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/box/box.cc b/src/box/box.cc
index 871b0d976..757dd93f1 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -230,7 +230,7 @@ static bool
 box_check_ro(void);
 
 void
-box_set_ro()
+box_set_ro(void)
 {
 	bool ro = box_check_ro();
 	if (ro == is_ro)
@@ -369,7 +369,7 @@ wal_stream_create(struct wal_stream *ctx)
 /* {{{ configuration bindings */
 
 static void
-box_check_say()
+box_check_say(void)
 {
 	enum say_logger_type type = SAY_LOGGER_STDERR; /* default */
 	const char *log = cfg_gets("log");
@@ -503,7 +503,7 @@ box_check_uuid(struct tt_uuid *uuid, const char *name)
 }
 
 static bool
-box_check_ro()
+box_check_ro(void)
 {
 	bool ro = cfg_geti("read_only") != 0;
 	bool anon = cfg_geti("replication_anon") != 0;
@@ -646,7 +646,7 @@ box_check_sql_cache_size(int size)
 }
 
 void
-box_check_config()
+box_check_config(void)
 {
 	struct tt_uuid uuid;
 	box_check_say();
@@ -2513,13 +2513,13 @@ box_cfg(void)
  * server forks in box.cfg{} if background=true.
  */
 void
-box_atfork()
+box_atfork(void)
 {
 	wal_atfork();
 }
 
 int
-box_checkpoint()
+box_checkpoint(void)
 {
 	/* Signal arrived before box.cfg{} */
 	if (! is_box_configured)
diff --git a/src/box/box.h b/src/box/box.h
index 557542a83..6baac1021 100644
--- a/src/box/box.h
+++ b/src/box/box.h
@@ -100,7 +100,7 @@ void
 box_atfork(void);
 
 void
-box_set_ro();
+box_set_ro(void);
 
 bool
 box_is_ro(void);
@@ -220,7 +220,7 @@ box_process_vote(struct ballot *ballot);
  * in case of a configuration change.
  */
 void
-box_check_config();
+box_check_config(void);
 
 void box_listen(void);
 void box_set_replication(void);
-- 
2.26.2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (21 preceding siblings ...)
  2020-07-03 14:45 ` [Tarantool-patches] [PATCH 22/22] box: " Cyrill Gorcunov
@ 2020-07-03 21:23 ` Vladislav Shpilevoy
  2020-07-04  7:30   ` Cyrill Gorcunov
  2020-07-08 12:55 ` Kirill Yukhin
  23 siblings, 1 reply; 30+ messages in thread
From: Vladislav Shpilevoy @ 2020-07-03 21:23 UTC (permalink / raw)
  To: Cyrill Gorcunov, tml; +Cc: Alexander Turenko

Hi!

Is there a measurement showing how this speeds up or reduces executable's
size anyhow?

Talking of the patch - why did you change .cc files? AFAIK, in C++
(void) and () are the same. Just no arguments.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list
  2020-07-03 21:23 ` [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Vladislav Shpilevoy
@ 2020-07-04  7:30   ` Cyrill Gorcunov
  2020-07-05 21:19     ` Timur Safin
  0 siblings, 1 reply; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-04  7:30 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tml, Alexander Turenko

On Fri, Jul 03, 2020 at 11:23:17PM +0200, Vladislav Shpilevoy wrote:
> Hi!
> 
> Is there a measurement showing how this speeds up or reduces executable's
> size anyhow?

Before

[cyrill@grain tarantool.git] size ./src/tarantool 
   text	   data	    bss	    dec	    hex	filename
6315490	  41788	 128920	6486198	 62f8b6	./src/tarantool

After

[cyrill@grain tarantool.git] size ./src/tarantool 
   text	   data	    bss	    dec	    hex	filename
6308034	  41788	 128920	6478742	 62db96	./src/tarantool

(it is debug build) Note the .text is been shrunk.

> 
> Talking of the patch - why did you change .cc files? AFAIK, in C++
> (void) and () are the same. Just no arguments.

True, still we've a mess between () and (void) in cc files, so
I unified the approach.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list
  2020-07-04  7:30   ` Cyrill Gorcunov
@ 2020-07-05 21:19     ` Timur Safin
  2020-07-05 21:37       ` Cyrill Gorcunov
  0 siblings, 1 reply; 30+ messages in thread
From: Timur Safin @ 2020-07-05 21:19 UTC (permalink / raw)
  To: 'Cyrill Gorcunov', 'Vladislav Shpilevoy'
  Cc: 'tml', 'Alexander Turenko'



: From: Cyrill Gorcunov
: Subject: Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty
: arguments list
: 
...
: 
: >
: > Talking of the patch - why did you change .cc files? AFAIK, in C++
: > (void) and () are the same. Just no arguments.
: 
: True, still we've a mess between () and (void) in cc files, so
: I unified the approach.

FWIW it's considered bad style to use (void) in C++ instead of ()

https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#nl25-dont-use-void-as-an-argument-type

¯\_(ツ)_/¯

Ешьгк

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list
  2020-07-05 21:19     ` Timur Safin
@ 2020-07-05 21:37       ` Cyrill Gorcunov
  2020-07-06 13:33         ` Timur Safin
  0 siblings, 1 reply; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-05 21:37 UTC (permalink / raw)
  To: Timur Safin
  Cc: 'tml', 'Vladislav Shpilevoy',
	'Alexander Turenko'

On Mon, Jul 06, 2020 at 12:19:30AM +0300, Timur Safin wrote:
> : 
> : >
> : > Talking of the patch - why did you change .cc files? AFAIK, in C++
> : > (void) and () are the same. Just no arguments.
> : 
> : True, still we've a mess between () and (void) in cc files, so
> : I unified the approach.
> 
> FWIW it's considered bad style to use (void) in C++ instead of ()
> 
> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#nl25-dont-use-void-as-an-argument-type
> 

IIRC we've been planning to switch to C eventually.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list
  2020-07-05 21:37       ` Cyrill Gorcunov
@ 2020-07-06 13:33         ` Timur Safin
  2020-07-06 15:09           ` Cyrill Gorcunov
  0 siblings, 1 reply; 30+ messages in thread
From: Timur Safin @ 2020-07-06 13:33 UTC (permalink / raw)
  To: 'Cyrill Gorcunov'
  Cc: 'tml', 'Vladislav Shpilevoy',
	'Alexander Turenko'

: From: Cyrill Gorcunov <gorcunov@gmail.com>
: Subject: Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty
: arguments list
: 
...
: 
: 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.

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. 

Timur

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list
  2020-07-06 13:33         ` Timur Safin
@ 2020-07-06 15:09           ` Cyrill Gorcunov
  0 siblings, 0 replies; 30+ messages in thread
From: Cyrill Gorcunov @ 2020-07-06 15:09 UTC (permalink / raw)
  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.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list
  2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
                   ` (22 preceding siblings ...)
  2020-07-03 21:23 ` [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Vladislav Shpilevoy
@ 2020-07-08 12:55 ` Kirill Yukhin
  23 siblings, 0 replies; 30+ messages in thread
From: Kirill Yukhin @ 2020-07-08 12:55 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: tml, Alexander Turenko

Hello,

On 03 июл 17:45, Cyrill Gorcunov wrote:
> Otherwise compiler treats function as accepting va_args making
> code complex on binary level. It's been boring and time consuming
> task to walk over sources and fixup the snippets but someone has
> to do id.
> 
> I split changes on per-file basis for easier application.
> 
> issue https://github.com/tarantool/tarantool/issues/4718
> branch gorcunov/gh-4718-use-void

I've checked your patch into master.

--
Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2020-07-08 12:55 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 01/22] version: use void for empty args Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 02/22] crc32: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 03/22] title: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 04/22] proc_title: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 05/22] systemd: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 06/22] main: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 07/22] say: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 08/22] memory: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 09/22] fiber: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 10/22] diag: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 11/22] coio: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 12/22] cbus: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 13/22] backtrace: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 14/22] call: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 15/22] call_id_cache: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 16/22] schema: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 17/22] sql: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 18/22] user: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 19/22] session: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 20/22] iproto: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 21/22] wal: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 22/22] box: " Cyrill Gorcunov
2020-07-03 21:23 ` [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Vladislav Shpilevoy
2020-07-04  7:30   ` Cyrill Gorcunov
2020-07-05 21:19     ` Timur Safin
2020-07-05 21:37       ` Cyrill Gorcunov
2020-07-06 13:33         ` Timur Safin
2020-07-06 15:09           ` Cyrill Gorcunov
2020-07-08 12:55 ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox