libuv icon indicating copy to clipboard operation
libuv copied to clipboard

inet: prefer sizeof with parenthesis

Open juanarbol opened this issue 8 months ago • 3 comments

This is not precisely a strict rule, but this syntax is reinforced in many large C projects like the Linux kernel and cURL.


From my POV, using parenthesis when using sizeof() is just less ambiguous.

But feel free to reject if u don't find this useful.

juanarbol avatar May 18 '25 17:05 juanarbol

I think overall we have more usage of no parentheses across the project, can you check?

saghul avatar May 19 '25 05:05 saghul

sizeof(x) is about 6.3x more prevalent than sizeof x

bnoordhuis avatar May 19 '25 08:05 bnoordhuis

Then it's settled!

saghul avatar May 19 '25 09:05 saghul