From c11f2f5de85c985733411776ab8e32ec8e3a64f8 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Mon, 28 Dec 2020 10:56:17 -0800 Subject: [PATCH] microsoft/compiler: Fix tautological comparison Clang detects that a signed character can't be >= 128. Instead, we should just explicitly check for the 8th bit via bitmask compare. Reviewed-by: Adam Jackson Part-of: --- src/microsoft/compiler/dxil_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/microsoft/compiler/dxil_module.c b/src/microsoft/compiler/dxil_module.c index 17e4a55db39..06af1f92f15 100644 --- a/src/microsoft/compiler/dxil_module.c +++ b/src/microsoft/compiler/dxil_module.c @@ -185,7 +185,7 @@ static bool is_char7_string(const char *str) { while (*str != '\0') { - if (*str++ >= 128) + if (*str++ & 0x80) return false; } return true;