[PATCH 06/11] Sptr: avoided potentially undefined behaviour.

Alejandro Colomar alx.manpages at gmail.com
Sat Jun 18 14:39:07 UTC 2022


Hi Andrew,

On 6/18/22 16:18, Andrew Clayton wrote:
> On Sat, 18 Jun 2022 16:07:51 +0200
> Alejandro Colomar <alx.manpages at gmail.com> wrote:
> 
>> I strongly prefer not having comments about how code works.
>> They tend to be obsolete, and maintaining comments is harder than the code.
> 
> There is certainly a fine line about when and what to comment.
>   
>> Better improve the code, adding these details to the commit log, where
>> the comment is tied to the point in time where it was true, forever.
> 
> In this case the code is so baroque that it really deserves a comment
> or you'll get people trying to fix it when it ain't broke ;)
> 
> Either that or as you suggest, re-work the code to make it more obvious
> about what's going on.
> 
> Now which patch (adding a comment or changing the code) has more chance
> of being accepted?!

If you simplify the code, you'll have all of my support.  I bet it can 
be simplified in terms of offsetof(3); you'll probably have to check all 
call sites for that.  If you manage to do it, and prove the patch is a 
no-op, you got me :-}

For the comment, I'm going to be _very_ picky.

Cheers,

Alex

-- 
Alejandro Colomar
<http://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.nginx.org/pipermail/unit/attachments/20220618/3d7ac98e/attachment.bin>


More information about the unit mailing list