[CRIU] [PATCHv2 1/3] util: Introduce STREQ and STRNEQ macros

Radostin Stoyanov rstoyanov1 at gmail.com
Tue Jan 29 17:40:14 MSK 2019


On 29/01/2019 13:22, Cyrill Gorcunov wrote:
> On Tue, Jan 29, 2019 at 01:11:19PM +0000, Radostin Stoyanov wrote:
>> The function strcmp() is often used to check whether two strings are
>> equal. The macros STREQ and STRNEQ could be used instead to improve
>> readability of the source code.
>>
>> - v2: surround the macro-variables with parenthesis (Thanks to Mike Rapoport)
> Don't want to disappoint you, but you know strcmp is well known library
> function and I don't see any reason to add an additional layer of syntactic
> sugar here. I simply don't get how it improves readability. Up to
> Andrew though. Don't get it close this is just my opinion.
Thank you for the feedback. Well if it does not improve readability for
others, and only adds additional layer of syntactic sugar, then it would
be better not to introduce these macros.

Radostin


More information about the CRIU mailing list