1 // RUN: %clang_cc1 -x c -Wunsafe-buffer-usage \
2 // RUN: -fsafe-buffer-usage-suggestions \
3 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
5 // RUN: %clang_cc1 -x c -std=c89 -Wunsafe-buffer-usage \
6 // RUN: -fsafe-buffer-usage-suggestions \
7 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
8 // RUN: %clang_cc1 -x c -std=gnu89 -Wunsafe-buffer-usage \
9 // RUN: -fsafe-buffer-usage-suggestions \
10 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
11 // RUN: %clang_cc1 -x c -std=iso9899:1990 -Wunsafe-buffer-usage \
12 // RUN: -fsafe-buffer-usage-suggestions \
13 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
15 // RUN: %clang_cc1 -x c -std=c17 -Wunsafe-buffer-usage \
16 // RUN: -fsafe-buffer-usage-suggestions \
17 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
18 // RUN: %clang_cc1 -x c -std=gnu17 -Wunsafe-buffer-usage \
19 // RUN: -fsafe-buffer-usage-suggestions \
20 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
21 // RUN: %clang_cc1 -x c -std=iso9899:2017 -Wunsafe-buffer-usage \
22 // RUN: -fsafe-buffer-usage-suggestions \
23 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
24 // RUN: %clang_cc1 -x c -std=c2x -Wunsafe-buffer-usage \
25 // RUN: -fsafe-buffer-usage-suggestions \
26 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
28 // RUN: %clang_cc1 -x c++ -std=c++98 -Wunsafe-buffer-usage \
29 // RUN: -fsafe-buffer-usage-suggestions \
30 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
31 // RUN: %clang_cc1 -x c++ -std=gnu++98 -Wunsafe-buffer-usage \
32 // RUN: -fsafe-buffer-usage-suggestions \
33 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
34 // RUN: %clang_cc1 -x c++ -std=c++17 -Wunsafe-buffer-usage \
35 // RUN: -fsafe-buffer-usage-suggestions \
36 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
37 // RUN: %clang_cc1 -x c++ -std=gnu++17 -Wunsafe-buffer-usage \
38 // RUN: -fsafe-buffer-usage-suggestions \
39 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
41 // RUN: %clang_cc1 -x objective-c++ -std=c++98 -Wunsafe-buffer-usage \
42 // RUN: -fsafe-buffer-usage-suggestions \
43 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
44 // RUN: %clang_cc1 -x objective-c++ -std=gnu++98 -Wunsafe-buffer-usage \
45 // RUN: -fsafe-buffer-usage-suggestions \
46 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
47 // RUN: %clang_cc1 -x objective-c++ -std=c++17 -Wunsafe-buffer-usage \
48 // RUN: -fsafe-buffer-usage-suggestions \
49 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
50 // RUN: %clang_cc1 -x objective-c++ -std=gnu++17 -Wunsafe-buffer-usage \
51 // RUN: -fsafe-buffer-usage-suggestions \
52 // RUN: -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
56 typedef int * Int_ptr_t
;
59 void local_array_subscript_simple() {
77 void local_ptr_to_array() {
88 void local_ptr_addrof_init() {
94 void decl_without_init() {
102 void explict_cast() {
108 char * q
= (char *)&a
;
112 char * s
= (char *) r
;