#define MAX_RETRIES 5
#define DEFAULT_TIMEOUT_MS 3000
#define SERVICE_NAME "billing"Deterministic line match: flags `#define` of an upper-case name whose value starts with a digit, quote, minus sign, or parenthesis, in C++ files.
`#define MAX_RETRIES 5` in C++: a macro used as a constant. It has no type, ignores scope, and is gone before the debugger sees it.
Each example shows the exact code shape the rule is looking for, then the smallest version that keeps the intent without hiding risk or adding noise.
#define MAX_RETRIES 5
#define DEFAULT_TIMEOUT_MS 3000
#define SERVICE_NAME "billing"Deterministic line match: flags `#define` of an upper-case name whose value starts with a digit, quote, minus sign, or parenthesis, in C++ files.
namespace billing {
constexpr int kMaxRetries = 5;
constexpr std::chrono::milliseconds kDefaultTimeout{3000};
constexpr std::string_view kServiceName = "billing";
}Use `constexpr` (or `const`) with an explicit type, inside a namespace or class if it belongs to one.
Agents copy constant definitions from C-era examples, where macros were the only option.
ai-slop/cpp-define-constant
ai-slop
Deterministic line match: flags `#define` of an upper-case name whose value starts with a digit, quote, minus sign, or parenthesis, in C++ files.
`.c` and `.h` files, include guards and other value-less defines, and function-like macros such as `#define MAX(a, b)` are not flagged.
Part of aislop's C/C++ rule set. C/C++ support, including C/C++-specific AI-slop rules, arrived in aislop v0.14.1.