[clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 13 22:41:02 PDT 2024


================
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only -std=c11
+
+int x(void) { e: b: ; return &&e - &&b < x; } // expected-warning {{ordered comparison between pointer and integer ('long' and 'int (*)(void)')}}
----------------
Sirraide wrote:

```suggestion
int x(void) { e: b: ; return &&e - &&b < x; } // expected-warning {{ordered comparison between pointer and integer}}
```
On Windows, this is a `long long`, not a `long`, which is why the test is currently failing.

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


More information about the cfe-commits mailing list