File: badtype2.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 (26 lines) | stat: -rw-r--r-- 723 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//typedef int undef;
extern undef bar(void);
static undef foo(char *c)
{
  char p = *c;
  switch (p) {
  default:
    return bar();
  }
}

/*
 * check-name: missing type
 * check-error-start
badtype2.c:2:8: warning: 'undef' has implicit type
badtype2.c:2:14: error: Expected ; at end of declaration
badtype2.c:2:14: error: got bar
badtype2.c:3:14: error: Expected ; at end of declaration
badtype2.c:3:14: error: got foo
badtype2.c:6:3: error: Trying to use reserved word 'switch' as identifier
badtype2.c:6:11: error: missing type declaration for parameter 'p'
badtype2.c:7:3: error: not in switch scope
badtype2.c:10:1: error: Expected ; at the end of type declaration
badtype2.c:10:1: error: got }
 * check-error-end
 */