Does anyone still feel strongly about -Wdeclaration-after-statement ?

Keith Packard keithp at keithp.com
Thu Aug 8 16:41:28 UTC 2024


> > Having said that, sticking with the local code style still trumps
> > anything, if you have 6 temp variables declared at the top mixed with 5
> > declared later that's more confusing than if all were at the top.
> 
> But also try to avoid gratuitous churn. I'm opposed to commit to just
> move variable declaration around "because we can".

At least the two of you seem to be in pretty strong agreement. Allow
people to use mixed code/decls where it improves readability during
larger work, but also strongly encourage people to preserve the existing
local style when making only minor changes.

I think we can all agree that the worst style is one which mixes
multiple conflicting elements together. A function with a dozen
declarations at the top of the block and then one random declaration
inserted in the middle at random is something we should avoid.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20240808/75ee1d97/attachment.sig>


More information about the xorg-devel mailing list