Clang Project

clang_source_code/test/Sema/format-strings-fixit-ssize_t.c
1// RUN: cp %s %t
2// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -std=c99 -pedantic -Wall -fixit %t
3// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -std=c99 -fsyntax-only -pedantic -Wall -Werror %t
4// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -std=c99 -E -o - %t | FileCheck %s
5
6/* This is a test of the various code modification hints that are
7   provided as part of warning or extension diagnostics. All of the
8   warnings will be fixed by -fixit, and the resulting file should
9   compile cleanly with -Werror -pedantic. */
10
11int printf(char const *, ...);
12int scanf(const char *, ...);
13
14void test() {
15  typedef signed long int ssize_t;
16  printf("%f", (ssize_t) 42);
17  ssize_t s;
18  scanf("%f",  &s);
19}
20
21// CHECK: printf("%zd", (ssize_t) 42);
22// CHECK: scanf("%zd", &s)
23