[PATCH] D41512: [Sema] -Wtautological-constant-compare is too good. Cripple it.
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 2 10:04:47 PST 2018
lebedev.ri added a comment.
@aaron.ballman, @smeenai, thank you for feedback!
Comment at: include/clang/Basic/DiagnosticGroups.td:440
def TautologicalUnsignedEnumZeroCompare : DiagGroup<"tautological-unsigned-enum-zero-compare">;
+def TautologicalRangeCompare : DiagGroup<"tautological-constant-range-compare">;
def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
> aaron.ballman wrote:
> > lebedev.ri wrote:
> > > rsmith wrote:
> > > > "tautological-constant-in-range-compare" would make more sense to me, as the complement of "tautological-constant-out-of-range-compare".
> > > I did think about it.
> > > To me "tautological-constant-in-range-compare" may sound as if the constant is //somewhere// in the range,
> > > while i'd say "tautological-constant-range-compare" better highlights the fact that the constant *is* the range limit.
> > > No?
> > I don't have strong opinions on this name, but have a slight preference for "in range" because I'm left wondering how "range compare" relates to "out of range compare".
> How about range-limit-compare or range-edge-compare or range-bound-compare or something of that nature, that explicitly captures the fact that it's the range limit?
Ok, `def TautologicalInRangeCompare : DiagGroup<"tautological-constant-in-range-compare",` it is then.
Comment at: include/clang/Basic/DiagnosticGroups.td:438
def StrncatSize : DiagGroup<"strncat-size">;
+def TautologicalTypeLimitCompare : DiagGroup<"tautological-type-limit-compare">;
def TautologicalUnsignedZeroCompare : DiagGroup<"tautological-unsigned-zero-compare">;
Any opinion on this one?
More information about the cfe-commits