| 1 |
// RUN: %clang_cc1 -fobjc-arc -verify %s |
| 2 |
|
| 3 |
#if __has_feature(arc_cf_code_audited) |
| 4 |
#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin") |
| 5 |
#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end") |
| 6 |
#endif |
| 7 |
#define CF_BRIDGED_TYPE(T) __attribute__((objc_bridge(T))) |
| 8 |
|
| 9 |
typedef const struct CF_BRIDGED_TYPE(NSURL) __CFURL * CFURLRef; |
| 10 |
typedef signed long long CFIndex; |
| 11 |
typedef unsigned char Boolean; |
| 12 |
typedef unsigned char UInt8; |
| 13 |
typedef const struct __CFAllocator * CFAllocatorRef; |
| 14 |
const CFAllocatorRef kCFAllocatorDefault; |
| 15 |
|
| 16 |
CF_IMPLICIT_BRIDGING_ENABLED |
| 17 |
CFURLRef CFURLCreateFromFileSystemRepresentation(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory); // expected-note {{passing argument to parameter 'buffer' here}} |
| 18 |
CF_IMPLICIT_BRIDGING_DISABLED |
| 19 |
|
| 20 |
void saveImageToJPG(const char *filename) |
| 21 |
{ |
| 22 |
CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, filename, 10, 0); // expected-warning {{passing 'const char *' to parameter of type 'const UInt8 *' (aka 'const unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not}} |
| 23 |
} |