OSDN Git Service

initial commit
[openbsd-octeon/openbsd-octeon.git] / src / regress / usr.bin / xlint / test-13.c
1 /*      $OpenBSD: test-13.c,v 1.1 2005/12/10 19:16:56 cloder Exp $      */
2
3 /*
4  * Placed in the public domain by Chad Loder <cloder@openbsd.org>.
5  *
6  * Test lint warnings regarding suspicious sizeof use.
7  */
8
9 typedef struct bar {
10         int a;
11 } bar_t;
12
13 /* ARGSUSED */
14 int
15 main(int argc, char *argv[])
16 {
17         bar_t bars[10];
18         unsigned int a;
19         
20         a = sizeof(argc + 1);   /* warn */
21         a = sizeof(1);          /* warn */
22         a = sizeof(bars[1]);    /* ok */
23         a = sizeof(bar_t);      /* ok */
24
25         a++;
26         return 0;
27 }
28
29