[PATCH] D145617: [clang-tidy] Add readability-avoid-unconditional-preprocessor-if check
Piotr Zegar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 18 10:47:13 PDT 2023
PiotrZSL added inline comments.
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/readability/avoid-unconditional-preprocessor-if.cpp:67-69
+#if 10 > DDD
+// some code
+#endif
----------------
carlosgalvezp wrote:
> Add case for if 10 < DDD ?
>
> Also, add test case for comparing 2 macros? If people follow the "no magic numbers" policy they'll likely have defines for both sides of the comparison.
I don't support currently macros, would need to check if they defined unconditionally in same file, and I didn't want to mess with this.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145617/new/
https://reviews.llvm.org/D145617
More information about the cfe-commits
mailing list