mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-20 03:55:48 -04:00

Re-enable format string warnings on printf. The warnings are still incomplete. Apparently it is undefined to use a vector specifier without a length modifier, which is not currently warned on. Additionally, type warnings appear to not be working with the hh modifier, and aren't warning on all of the special restrictions from c99 printf. llvm-svn: 352540
13 lines
552 B
Common Lisp
13 lines
552 B
Common Lisp
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -finclude-default-header
|
|
|
|
// Make sure warnings are produced based on printf format strings.
|
|
|
|
kernel void format_string_warnings(__constant char* arg) {
|
|
|
|
printf("%d", arg); // expected-warning {{format specifies type 'int' but the argument has type '__constant char *'}}
|
|
|
|
printf("not enough arguments %d %d", 4); // expected-warning {{more '%' conversions than data arguments}}
|
|
|
|
printf("too many arguments", 4); // expected-warning {{data argument not used by format string}}
|
|
}
|