Conversation

Clang tidy's readability-magic-numbers check is a nightmare. h_malloc.c:236:28: warning: 4096 is a magic number; consider replacing it with a named constant [readability-magic-numbers] static_assert(PAGE_SIZE == 4096, "bitmap handling will need adjustment for other page sizes");
3
9
Replying to and
It's Clang's linter rather than the compiler. I'm explicitly asking it to be opinionated about code style by passing -checks=readability-* but it doesn't make this an acceptable lint pass. The checks in readability should be sensible and avoid spewing out tons of false positives.
1
I'd appreciate it if they added more ways of enforce code style. For example, I'd like a readability lint for detecting variables scoped more broadly than they could be within blocks (i.e. variable address not taken and only used within inner block scope). This one sucks though.
3
2