Conversation
…tandardize function declarations with explicit `void` parameters for consistency.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #806 +/- ##
==========================================
- Coverage 91.52% 91.47% -0.06%
==========================================
Files 236 236
Lines 29561 28818 -743
==========================================
- Hits 27057 26361 -696
+ Misses 2504 2457 -47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pnoltes
left a comment
There was a problem hiding this comment.
Nice PR. I was not aware that this is possible and this looks like a good addition to make the code more readable and even more when using clang-tidy.
Should we also add clang-tidy to our CI?
For the usage of '(void)' for an explicit empty argument list, maybe this should also be added to our coding conventions documentation.
And ideally when to use 'CELIX_OWNERSHIP_RETURNS', '_TAKES' and ' _HOLDS' should also be documented.
Yes.
I am currently working on fixing the |
Description
This pull request focuses on improving code clarity and consistency. The changes include:
voidin parameter lists for consistency.CELIX_HAS_ATTRIBUTEmacro to check for attribute support.Usage
Enable the following clang-tidy checks to see its effects:
Both vscode and Clion IDE have good integrations with clang-tidy.
Limitations
ownership_returnscan only be used to mark functions returning their allocations through return values, i.e., output parameter is not supported, see [analyzer] Extend ownership_returns attribute to cover output parameters llvm/llvm-project#166122The first issue leads to lots of false-positives, which can fortunately be suppressed using
NOLINTmacros. I will try to fix both issues in the Clang upstream.