Issue 157381
Summary -Wtautological-type-limit-compare shouldn't
Labels new issue
Assignees
Reporter LevoDeLellis
    I had to do a double take on this warning

> warning: result of comparison 'const char' <= 127 is always true
> $ ./a.out
> False

char isn't unsigned char and clang isn't the only compiler. From a quick glance at a C++26 draft it doesn't seem to specify it must be signed, so this appears to be an incorrect warning

```
#include <stdio.h>
const char*text="";
int main() {
	if (text[0] <= 127 && text[0] > 0) {
		puts("True");
	} else {
		puts("False");
	}
}

```

> clang version 20.1.8
> Target: x86_64-pc-linux-gnu

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to