From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 8555E121FDA3; Thu, 30 Jan 2025 16:55:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8555E121FDA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1738245339; bh=rGReKsLmIU/eJvv3L7hx7ly3RPo3D0lmAaTc7rwXVXw=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=HwK1oBk6P+szvdpmi6sfAv2Ai32FQZCgODDlzMxaqgtNtIxIgqMaQZ7VKTT6SruOF cyI9w2l5R+yZef1JT2uE/8wj5B2jsOFbW5/nk30tGWAElSK6IAg9efYvGOpxoFVUsA F0A1KYkjhdRBFO1QDyL2I7R3UqqqThIOXyFnKW9s= Received: from send129.i.mail.ru (send129.i.mail.ru [89.221.237.224]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 4D79845AE56 for ; Thu, 30 Jan 2025 16:55:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4D79845AE56 Received: by exim-smtp-5d58c69cd6-rmdw4 with esmtpa (envelope-from ) id 1tdV17-00000000RwH-1GqS; Thu, 30 Jan 2025 16:55:37 +0300 Content-Type: multipart/alternative; boundary="------------uxMeYfxv0kXP7clbGKhlBv2e" Message-ID: Date: Thu, 30 Jan 2025 16:55:36 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org References: <9b29c3fc69a0245861959fe80a322dc84ba8160b.1738143566.git.sergeyb@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9279F651DE5037A5080B62BE5EE696263B6D179FE0FDCC17E1313CFAB8367EF908E2BE116634AD74DFC12FFB1A52A249E03AAE3001806DF10F2E9048E3A170831F2F38B28A0AF888FCEE4813122F9A0DF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DECE8D0A5E25C0FCEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637C867FEFF36BCDF178638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D535A558A59431276834EDAE218F1915304F7D20827AB0F1CC7F00164DA146DAFE8445B8C89999728AA50765F790063741F7343E26298569389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC821E93C0F2A571C7BF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CAD0E433DBF1FBFA3040F9FF01DFDA4A84AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C319DD8FA685349A95BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF17B107DEF921CE791DD303D21008E298D5E8D9A59859A8B6957A4DEDD2346B4275ECD9A6C639B01B78DA827A17800CE7AEA1580DED4E70E3731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A58A1955AE0E68C2005002B1117B3ED696F6A5D6E16F6D97801E49B01306B5E3AD823CB91A9FED034534781492E4B8EEADEF0AF71940E62277BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D344B4608D01B1CB59AAA07B6809ABE044A941BE8F397A757DB14C4C6C65C3ADD48E573148DD4D5E97D1D7E09C32AA3244C2846AA728E03713077DD89D51EBB77429F99FECECBAD77ECEA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59978A700BF655EAEEED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojB5k2t8NeLmD5bnMrZGCIRg== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D6140FC12FFB1A52A249E03AAE3001806DF1004F599B657FADDE60152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] test: define UNUSED macros only once X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------uxMeYfxv0kXP7clbGKhlBv2e Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Sergey, thanks for review! Changes force-pushed. Sergey On 29.01.2025 17:55, Sergey Kaplun via Tarantool-patches wrote: > 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/ Fixed. > >> `tarantool-c-tests`. The patch defines macros only once in > Typo: s/macros/macro/ Fixed. > >> `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 >> > > >> 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 >> #include >> >> +#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. Updated: --- a/test/tarantool-c-tests/test.h +++ b/test/tarantool-c-tests/test.h @@ -4,7 +4,9 @@  #include  #include +#ifndef UNUSED  #define UNUSED(x) ((void)(x)) +#endif  /*   * Test module, based on TAP 14 specification [1]. > >> + >> /* >> * Test module, based on TAP 14 specification [1]. >> * [1]:https://testanything.org/tap-version-14-specification.html > > > [1]:https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html > --------------uxMeYfxv0kXP7clbGKhlBv2e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi, Sergey,

thanks for review! Changes force-pushed.

Sergey

On 29.01.2025 17:55, Sergey Kaplun via Tarantool-patches wrote:
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/
Fixed.

`tarantool-c-tests`. The patch defines macros only once in
Typo: s/macros/macro/
Fixed.

`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.

Updated:

--- a/test/tarantool-c-tests/test.h
+++ b/test/tarantool-c-tests/test.h
@@ -4,7 +4,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#ifndef UNUSED
 #define UNUSED(x) ((void)(x))
+#endif
 
 /*
  * Test module, based on TAP 14 specification [1].


+
 /*
  * 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

--------------uxMeYfxv0kXP7clbGKhlBv2e--