function_hooks: update comment explaining various function hooks
[smatch.git] / validation / preprocessor / preprocessor22.c
blob0d13c5f8a6113cae78e8093c78fd99501ade1cce
1 #define CONFIG_FOO 1
3 #define define_struct(name, fields...) struct fields name;
5 define_struct(a, {
6 #ifdef CONFIG_FOO
7 int b;
8 #elif defined(CONFIG_BAR)
9 int c;
10 #else
11 int d;
12 #endif
13 });
15 * check-name: Preprocessor #22
17 * check-description: Directives are not allowed within a macro argument list,
18 * although cpp deals with it to treat macro more like C functions.
20 * check-command: sparse -pedantic -E $file
22 * check-error-start
23 preprocessor/preprocessor22.c:6:1: warning: directive in macro's argument list
24 preprocessor/preprocessor22.c:8:1: warning: directive in macro's argument list
25 preprocessor/preprocessor22.c:10:1: warning: directive in macro's argument list
26 preprocessor/preprocessor22.c:12:1: warning: directive in macro's argument list
27 * check-error-end
29 * check-output-start
31 struct { int b; } a;;
32 * check-output-end