File: enum-type-dubious.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 (18 lines) | stat: -rw-r--r-- 580 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
enum foobar {
	FOO = (void*)0,
	BAR = (void*)1,
	BAZ = (int*)0,
	QUX = (int*)123,
};

/*
 * check-name: enum-type-dubious
 * check-known-to-fail
 *
 * check-error-start
validation/enum-type-dubious.c:2:8: error: enumerator value for 'FOO' is not an integer constant
validation/enum-type-dubious.c:3:8: error: enumerator value for 'BAR' is not an integer constant
validation/enum-type-dubious.c:4:8: error: enumerator value for 'BAZ' is not an integer constant
validation/enum-type-dubious.c:5:8: error: enumerator value for 'QUX' is not an integer constant
 * check-error-end
 */