[clang] [analyzer] Model overflow builtins (PR #102602)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 04:52:02 PDT 2024


================
@@ -0,0 +1,30 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output text \
+// RUN:   -verify %s
+
+void test_no_overflow_note(int a, int b)
+{
+   int res;
+
+   if (__builtin_add_overflow(a, b, &res)) // expected-note {{Assuming overflow does not happen}}
----------------
steakhal wrote:

Maybe it's just me, but I find this phrasing a bit weird.
To me it would read a lot more natural if it was `Assuming overflow` or `Assuming no overflow`. Maybe suffixed with `... happens`.

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


More information about the cfe-commits mailing list