summaryrefslogtreecommitdiffstats
path: root/docs/analyzer/checkers/dividezero_example.c
diff options
context:
space:
mode:
Diffstat (limited to 'docs/analyzer/checkers/dividezero_example.c')
-rw-r--r--docs/analyzer/checkers/dividezero_example.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/analyzer/checkers/dividezero_example.c b/docs/analyzer/checkers/dividezero_example.c
new file mode 100644
index 0000000000..00ffaac491
--- /dev/null
+++ b/docs/analyzer/checkers/dividezero_example.c
@@ -0,0 +1,9 @@
+void test(int z) {
+ if (z == 0)
+ int x = 1 / z; // warn
+}
+
+void test() {
+ int x = 1;
+ int y = x % 0; // warn
+}