1 // RUN: %clang_analyze_cc1 -analyzer-checker=core %s -verify
2 // expected-no-diagnostics
10 static void create(const Params
* const params
, int fooList
[]) {
11 int tmpList
[SIZE
] = {0};
12 for (int i
= 0; i
< params
->noOfSymbols
; i
++)
13 fooList
[i
] = tmpList
[i
];
16 int work(Params
* const params
) {
18 create(params
, fooList
);
20 for (int i
= 0; i
< params
->noOfSymbols
; i
++)
21 sum
+= fooList
[i
]; // no-warning
25 static void create2(const Params
* const * pparams
, int fooList
[]) {
26 const Params
* params
= *pparams
;
27 int tmpList
[SIZE
] = {0};
28 for (int i
= 0; i
< params
->noOfSymbols
; i
++)
29 fooList
[i
] = tmpList
[i
];
32 int work2(const Params
* const params
) {
34 create2(¶ms
, fooList
);
36 for (int i
= 0; i
< params
->noOfSymbols
; i
++)
37 sum
+= fooList
[i
]; // no-warning
41 static void create3(Params
* const * pparams
, int fooList
[]) {
42 const Params
* params
= *pparams
;
43 int tmpList
[SIZE
] = {0};
44 for (int i
= 0; i
< params
->noOfSymbols
; i
++)
45 fooList
[i
] = tmpList
[i
];
48 int work3(const Params
* const params
) {
50 Params
*const *ptr
= (Params
*const*)¶ms
;
51 create3(ptr
, fooList
);
53 for (int i
= 0; i
< params
->noOfSymbols
; i
++)
54 sum
+= fooList
[i
]; // no-warning
58 typedef Params ParamsTypedef
;
59 typedef const ParamsTypedef
*ConstParamsTypedef
;
61 static void create4(ConstParamsTypedef
const params
, int fooList
[]) {
62 int tmpList
[SIZE
] = {0};
63 for (int i
= 0; i
< params
->noOfSymbols
; i
++)
64 fooList
[i
] = tmpList
[i
];
67 int work4(Params
* const params
) {
69 create4(params
, fooList
);
71 for (int i
= 0; i
< params
->noOfSymbols
; i
++)
72 sum
+= fooList
[i
]; // no-warning