Ted Kremenek | 826d5b4 | 2011-07-14 06:49:52 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i386-apple-macosx10.7.0 -fsyntax-only -verify -Wformat-nonliteral %s |
| 2 | |
| 3 | int printf(const char *restrict, ...); |
| 4 | |
| 5 | // Test that 'long' is compatible with 'int' on 32-bit. |
| 6 | typedef unsigned int UInt32; |
| 7 | void test_rdar_9763999() { |
| 8 | UInt32 x = 7; |
| 9 | printf("x = %u\n", x); // no-warning |
| 10 | } |
| 11 | |
| 12 | void test_positive() { |
| 13 | printf("%d", "hello"); // expected-warning {{conversion specifies type 'int' but the argument has type 'char *'}} |
| 14 | } |
| 15 | |