[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Analysis / security-syntax-checks.c
blob392a65ff5f167ce563da8ed7210719fe48796363
1 // RUN: %clang_analyze_cc1 %s -verify \
2 // RUN: -analyzer-checker=security.insecureAPI
3 // RUN: %clang_analyze_cc1 %s -verify -std=gnu11 \
4 // RUN: -analyzer-checker=security.insecureAPI
5 // RUN: %clang_analyze_cc1 %s -verify -std=gnu99 \
6 // RUN: -analyzer-checker=security.insecureAPI
8 void builtin_function_call_crash_fixes(char *c) {
9 __builtin_strncpy(c, "", 6);
10 __builtin_memset(c, '\0', (0));
11 __builtin_memcpy(c, c, 0);
13 #if __STDC_VERSION__ > 199901
14 // expected-warning@-5{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
15 // expected-warning@-5{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard.}}
16 // expected-warning@-5{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
17 #else
18 // expected-no-diagnostics
19 #endif