// NOTE - Informational message.
// WARNING - Warning.
// EXTENSION - Notification that an extension to the language is being used.
+// EXTWARN - Warning for behaviour that is supported as an extension. This
+// differs from EXTENSION in that the warning is always emitted
+// by default.
// ERROR - Error, compilation will stop after parsing completes.
//===----------------------------------------------------------------------===//
// assignment related diagnostics (also for argument passing, returning, etc).
DIAG(err_typecheck_convert_incompatible, ERROR,
"incompatible type %2 '%1', expected '%0'")
-DIAG(ext_typecheck_convert_pointer_int, EXTENSION,
+DIAG(ext_typecheck_convert_pointer_int, EXTWARN,
"incompatible pointer to integer conversion %2 '%1', expected '%0'")
-DIAG(ext_typecheck_convert_int_pointer, EXTENSION,
+DIAG(ext_typecheck_convert_int_pointer, EXTWARN,
"incompatible integer to pointer conversion %2 '%1', expected '%0'")
DIAG(ext_typecheck_convert_pointer_void_func, EXTENSION,
"%2 '%1' converts between void* and function pointer, expected '%0'")
-DIAG(ext_typecheck_convert_incompatible_pointer, EXTENSION,
+DIAG(ext_typecheck_convert_incompatible_pointer, EXTWARN,
"incompatible pointer types %2 '%1', expected '%0'")
-DIAG(ext_typecheck_convert_discards_qualifiers, EXTENSION,
+DIAG(ext_typecheck_convert_discards_qualifiers, EXTWARN,
"%2 '%1' discards qualifiers, expected '%0'")
DIAG(err_typecheck_array_not_modifiable_lvalue, ERROR,
return [s compare:aString options:op range:R locale:0]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:locale:' cannot be nil.}}
}
-NSComparisonResult f6(NSString* s) {
+NSArray *f6(NSString* s) {
return [s componentsSeparatedByCharactersInSet:0]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil.}}
}
NSString* f7(NSString* s1, NSString* s2, NSString* s3) {
- NSString* s4 = CFStringCreateWithFormat(kCFAllocatorDefault, 0,
- L"%@ %@ (%@)",
- s1, s2, s3);
+ NSString* s4 = (NSString*)
+ CFStringCreateWithFormat(kCFAllocatorDefault, 0,
+ (CFStringRef) __builtin___CFStringMakeConstantString("%@ %@ (%@)"),
+ s1, s2, s3);
CFRetain(s4);
return s4; // expected-warning{{leak}}
va_list ap;
va_start(ap,b);
- printf(L"foo %d",2); // expected-warning {{should not be a wide string}}
- vasprintf(&b,L"bar %d",ap); // expected-warning {{should not be a wide string}}
+ printf(L"foo %d",2); // expected-warning {{incompatible pointer types}}, expected-warning {{should not be a wide string}}
+ vasprintf(&b,L"bar %d",ap); // expected-warning {{incompatible pointer types}}, expected-warning {{should not be a wide string}}
}
void check_asterisk_precision_width(int x) {
printf("%*d",12,x); // no-warning
printf("%*d","foo",x); // expected-warning {{field width should have type 'int', but argument has type 'char *'}}
printf("%.*d","foo",x); // expected-warning {{field precision should have type 'int', but argument has type 'char *'}}
-}
\ No newline at end of file
+}