|
|
Subscribe / Log in / New account

Catching the mismatch

Catching the mismatch

Posted Feb 11, 2025 17:35 UTC (Tue) by mathstuf (subscriber, #69389)
In reply to: Catching the mismatch by farnz
Parent article: Maintainer opinions on Rust-for-Linux

There are `clang-tidy` checks that check that the declaration parameter name matches the definition name. Nothing more fun than staring at code with a `int f(int a, int b)` declaration but a `int f(int b, int a)` typo in the definition. Though these tools can "read" comments to know that `/*b*/` at the definition site matches the declaration name as well.

See this Rust issue as well for when `_arg` naming is unwelcome: https://github.com/rust-lang/rust/issues/91074


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds