[clang] [analyzer] Update the undefined assignment checker diagnostics to not use the term 'garbage' (PR #126596)

Donát Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 10 14:55:18 PST 2025


https://github.com/NagyDonat requested changes to this pull request.

I think "garbage" is a perfectly acceptable word, I don't think that its "snarkiness" is a problem. (Note that e.g. "garbage collector" is a well-established notion in programming.)

Even if you want to replace it, you need to preserve that in the original phrasing
- "undefined" is a specific term that's defined by the standard (relying on that value is [_undefined behavior™_|https://en.cppreference.com/w/cpp/language/ub] aka may launch the nukes if the compiler wants to do so);
- "garbage" represents a variety of other cases that do not trigger _undefined behavior™_ but are still somehow problematic values that should not be used within a normal code (e.g. values that are "implementation-defined", moved-from objects etc.).

This means that the messages should look like "undefined or X" (instead of your wording, which uses "and").

I think replacing "garbage" with "not meaningful" would be a step backwards. (E.g. for me saying that a value is "not meaningful" would include cases like zeros or 0xDEADBEEF that fill an array just to ensure that it's initialized, but without any semantic meaning.) I'd say that "not meaningful" is also barely acceptable, but I'm casting one vote against it.

https://github.com/llvm/llvm-project/pull/126596


More information about the cfe-commits mailing list