1void test(int z) {
2 if (z == 0)
3 int x = 1 / z; // warn
4}
5
6void test() {
7 int x = 1;
8 int y = x % 0; // warn
9}
10

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of clang/docs/analyzer/checkers/dividezero_example.c