summaryrefslogtreecommitdiff
path: root/tests/warn/unknown-parameter.h
blob: 384704dff3e1c3ad570e994bdcbe5591664640eb (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* See https://bugzilla.gnome.org/show_bug.cgi?id=629708 */

/**
 * test_param_mismatch:
 * @wrong_name: (out):
 *
 */
void test_param_mismatch(int *out);

// EXPECT:5: Warning: Test: test_param_mismatch: unknown parameter 'wrong_name' in documentation comment, should be 'out'

/**
 * test_param_mismatch2:
 * @wrong_name2: (out):
 *
 */
void test_param_mismatch2(int a, int *out2);

// EXPECT:14: Warning: Test: test_param_mismatch2: unknown parameter 'wrong_name2' in documentation comment, should be one of 'a', 'out2'

/**
 * test_param_mismatch3:
 * @a: an integer
 * @wrong_name3: (out):
 *
 */
void test_param_mismatch3(int a, int *out3);

// EXPECT:24: Warning: Test: test_param_mismatch3: unknown parameter 'wrong_name3' in documentation comment, should be 'out3'

/**
 * test_param_missing:
 * @missing: (out):
 *
 */
void test_param_missing(void);

// EXPECT:33: Warning: Test: test_param_missing: unknown parameter 'missing' in documentation comment


/**
 * test_param_vargs:
 * @...: The varargs
 *
 */
void test_param_varargs(int i, ...);

// Should not warn

/**
 * test_undocumentable_param:
 */
void test_undocumentable_param(int);

// EXPECT:53: Warning: Test: symbol='test_undocumentable_param': missing parameter name; undocumentable

void test_undocumentable_param_2(int a, int);

// EXPECT:57: Warning: Test: symbol='test_undocumentable_param_2': missing parameter name; undocumentable

void test_undocumentable_param_3(int, int);

// EXPECT:61: Warning: Test: symbol='test_undocumentable_param_3': missing parameter name; undocumentable
// EXPECT:61: Warning: Test: symbol='test_undocumentable_param_3': missing parameter name; undocumentable

void test_void(void);

// Should not warn