Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <estetus@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] test: define UNUSED macros only once
Date: Wed, 29 Jan 2025 17:55:16 +0300	[thread overview]
Message-ID: <Z5pBVDYaRHaRom7Z@root> (raw)
In-Reply-To: <9b29c3fc69a0245861959fe80a322dc84ba8160b.1738143566.git.sergeyb@tarantool.org>

Hi, Sergey!
Thanks for the patch!
LGTM, with a minor comment below.

On 29.01.25, Sergey Bronnikov wrote:
> The macros `UNUSED` is widely used across the suite

Typo: s/macros/macro/

> `tarantool-c-tests`. The patch defines macros only once in

Typo: s/macros/macro/

> `test.h` to reuse it in other tests and removes definitions in
> tests.
> ---
> 
> Branch: https://github.com/tarantool/luajit/tree/ligurio/gh-xxxx-define-unused
> 

<snipped>

> diff --git a/test/tarantool-c-tests/test.h b/test/tarantool-c-tests/test.h
> index 3b22fb92..c1717932 100644
> --- a/test/tarantool-c-tests/test.h
> +++ b/test/tarantool-c-tests/test.h
> @@ -4,6 +4,8 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>  
> +#define UNUSED(x) ((void)(x))

Minor: I suggest to wrapping this into the `#ifndef`, since the
`UNUSED()` is a very common macro. The same one is used in the LuaJIT.
For now these macros are the same [1] but to avoid rewriting code in the
case of the changes, it is better to use `#ifndef` directive here.

> +
>  /*
>   * Test module, based on TAP 14 specification [1].
>   * [1]: https://testanything.org/tap-version-14-specification.html

<snipped>

[1]: https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html

-- 
Best regards,
Sergey Kaplun

  reply	other threads:[~2025-01-29 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29  9:39 Sergey Bronnikov via Tarantool-patches
2025-01-29 14:55 ` Sergey Kaplun via Tarantool-patches [this message]
2025-01-30 13:55   ` Sergey Bronnikov via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z5pBVDYaRHaRom7Z@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=estetus@gmail.com \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] test: define UNUSED macros only once' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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