lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 19 Nov 2021 16:13:29 +0100
From:   "Alejandro Colomar (man-pages)" <alx.manpages@...il.com>
To:     Alexey Dobriyan <adobriyan@...il.com>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/17] Add memberof(), split some headers, and slightly
 simplify code

Hi Alexey,

On 11/19/21 16:07, Alexey Dobriyan wrote:
>> +#define memberof(T, m)   (((T *) NULL)->m)
>> +
>>  #define typeof_member(T, m)	typeof(((T*)0)->m)
> 
> No.
> 
> Your macro exists already under different name.
> 
> sizeof_member and typeof_member exist, you don't anything more.
> 

The macro memberof() exists in one file (or 2)
under the name struct_member(), IIRC.

sizeof_member(), which is actually sizeof_field, IIRC,
and typeof_member(),
make use of this construction,
but they unnecessarily repeat it,
and there are other cases where code wants exactly memberof(),
not any of its wrappers.

I think that macro makes a lot of sense.

If you prefer the name struct_member() instead of memberof(),
I'm fine with it.
I just found that name much later than writing memberof(),
and memberof() was more consistent
with the typical naming of xxxof() for similar macros.

Thanks,
Alex

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ