File: cond_expr3.c

package info (click to toggle)
sparse 0.6.4-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,868 kB
  • sloc: ansic: 46,050; sh: 614; python: 301; perl: 293; makefile: 279
file content (17 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
static int icmp = 1 / (sizeof(int) - sizeof(1 > 0));
static int fcmp = 1 / (sizeof(int) - sizeof(1.0 == 2.0 - 1.0));
static int lnot = 1 / (sizeof(int) - sizeof(!!1.0));
static int land = 1 / (sizeof(int) - sizeof(2 && 3));
static int lor  = 1 / (sizeof(int) - sizeof('c' || 1.0f));

/*
 * check-name: result type of relational and logical operators
 *
 * check-error-start
cond_expr3.c:1:21: warning: division by zero
cond_expr3.c:2:21: warning: division by zero
cond_expr3.c:3:21: warning: division by zero
cond_expr3.c:4:21: warning: division by zero
cond_expr3.c:5:21: warning: division by zero
 * check-error-end
 */