File: preprocessor8.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 (38 lines) | stat: -rw-r--r-- 933 bytes parent folder | download | duplicates (8)
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
27
28
29
30
31
32
33
34
35
36
37
38
#define A(x) ## x
#define B(x) x ##
#define C(x) x ## ## ##
#define D(x) x#y
#define E x#y
#define F(x,y) x x##y #x y
#define G a##b
#define H 1##2
#define I(x,y,z) x y z
"A(x)"			: A(x)
"B(x)"			: B(x)
"C(x)"			: C(x)
"D(x)"			: D(x)
"x#y"			: E
"ab GH \"G\" 12"	: F(G,H)
"a ## b"		: I(a,##,b)
/*
 * check-name: Preprocessor #8
 * check-command: sparse -E $file
 *
 * check-output-start

"A(x)" : A(x)
"B(x)" : B(x)
"C(x)" : C(x)
"D(x)" : D(x)
"x#y" : x#y
"ab GH \"G\" 12" : ab GH "G" 12
"a ## b" : a ## b
 * check-output-end
 *
 * check-error-start
preprocessor/preprocessor8.c:1:14: error: '##' cannot appear at the ends of macro expansion
preprocessor/preprocessor8.c:2:16: error: '##' cannot appear at the ends of macro expansion
preprocessor/preprocessor8.c:3:22: error: '##' cannot appear at the ends of macro expansion
preprocessor/preprocessor8.c:4:15: error: '#' is not followed by a macro parameter
 * check-error-end
 */