• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching +full:argument +full:- +full:count

1 // RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin -analyzer-output=text\
2 // RUN: -analyzer-checker=osx.coreFoundation.containers.PointerSizedValues\
3 // RUN: -analyzer-checker=osx.coreFoundation.containers.OutOfBounds\
4 // RUN: -verify %s
102 void testContainers(int **xNoWarn, CFIndex count) {
105 …// expected-warning@-1 {{The second argument to 'CFArrayCreate' must be a C array of pointer-sized…
106 …// expected-note@-2 {{The second argument to 'CFArrayCreate' must be a C array of pointer-sized…
113 …// expected-warning@-1 {{The second argument to 'CFSetCreate' must be a C array of pointer-sized v…
114 …// expected-note@-2 {{The second argument to 'CFSetCreate' must be a C array of pointer-sized v…
115 CFArrayRef* pairs = new CFArrayRef[count];
116 …CFSetRef fSet = CFSetCreate(kCFAllocatorDefault, (const void**) pairs, count - 1, &kCFTypeSetCallB…
137 // expected-warning@-1 {{The second argument to 'CFDictionaryCreate' must be a C array of}}
138 // expected-note@-2 {{The second argument to 'CFDictionaryCreate' must be a C array of}}
139 // expected-warning@-3{{cast to 'const void **' from smaller integer type 'int'}}
141 …// expected-warning@-1 {{The third argument to 'CFDictionaryCreate' must be a C array of pointer-s…
142 …// expected-note@-2 {{The third argument to 'CFDictionaryCreate' must be a C array of pointer-s…
149 const void *s2 = CFArrayGetValueAtIndex(array, S-1); // no warning
150 …const void *s3 = CFArrayGetValueAtIndex(array, S); // expected-warning {{Index is out of bounds}}
151 … // expected-note@-1 {{Index is out of bounds}}
159 const void *s3 = CFArrayGetValueAtIndex(array, 5); // expected-warning {{Index is out of bounds}}
160 // expected-note@-1 {{Index is out of bounds}}
173 const void *s1 = CFArrayGetValueAtIndex(array, 0); // expected-warning {{Index is out of bounds}}
174 // expected-note@-1 {{Index is out of bounds}}
178 CFIndex sCount = CFArrayGetCount(A); // expected-note{{'sCount' initialized here}}
179 if (sCount > sIndex) // expected-note{{Assuming 'sCount' is <= 'sIndex'}}
180 // expected-note@-1{{Taking false branch}}
182 const void *s2 = CFArrayGetValueAtIndex(A, sCount);// expected-warning {{Index is out of bounds}}
183 // expected-note@-1 {{Index is out of bounds}}
187 void TestPointerToArray(int *elems, void *p1, void *p2, void *p3, unsigned count, void* fn[], char …
189 CFArrayCreate(0, (const void **) &x, count, 0); // no warning
192 CFArrayCreate(0, (const void **) y, count, 0); // no warning
194 CFArrayCreate(0, (const void **) z, count, 0); // no warning
196 CFArrayCreate(0, (const void **) &fn, count, 0); // false negative
197 CFArrayCreate(0, (const void **) fn, count, 0); // no warning
198 …te(0, (const void **) cp, count, 0); // expected-warning {{The second argument to 'CFArrayCreate' …
199 … // expected-note@-1 {{The second argument to 'CFArrayCreate' must be a C array of pointer-sized}}
202 …e(0, (const void **) &cc, count, 0); // expected-warning {{The second argument to 'CFArrayCreate' …
203 … // expected-note@-1 {{The second argument to 'CFArrayCreate' must be a C array of pointer-sized}}
204 …te(0, (const void **) cc, count, 0); // expected-warning {{The second argument to 'CFArrayCreate' …
205 … // expected-note@-1 {{The second argument to 'CFArrayCreate' must be a C array of pointer-sized}}
240 CFIndex aLen = CFArrayGetCount(a); // expected-note{{'aLen' initialized here}}
245 CFArrayGetValueAtIndex(a, aLen); // expected-warning {{Index is out of bounds}}
246 // expected-note@-1 {{Index is out of bounds}}