Merge "Add/allow clang-14 warnings."
This commit is contained in:
commit
aaf20e105c
2 changed files with 7 additions and 0 deletions
|
@ -497,6 +497,7 @@ cc_library {
|
|||
"-Wno-missing-braces",
|
||||
"-Wno-parentheses",
|
||||
"-Wno-sign-compare",
|
||||
"-Wno-static-in-inline",
|
||||
"-Wno-unknown-pragmas",
|
||||
"-Wno-unused-const-variable",
|
||||
"-Wno-unused-variable",
|
||||
|
|
|
@ -164,6 +164,9 @@ FORTIFY_TEST(string) {
|
|||
const char large_string[] = "Hello!!!";
|
||||
static_assert(sizeof(large_string) > sizeof(small_buffer), "");
|
||||
|
||||
#if __clang_major__ > 13
|
||||
// expected-error@+3{{will always overflow}}
|
||||
#endif
|
||||
// expected-error@+1{{string bigger than buffer}}
|
||||
EXPECT_FORTIFY_DEATH(strcpy(small_buffer, large_string));
|
||||
// expected-error@+1{{string bigger than buffer}}
|
||||
|
@ -201,6 +204,9 @@ FORTIFY_TEST(string) {
|
|||
static_assert(sizeof(small_string) > sizeof(split.tiny_buffer), "");
|
||||
|
||||
#if _FORTIFY_SOURCE > 1
|
||||
#if __clang_major__ > 13
|
||||
// expected-error@+4{{will always overflow}}
|
||||
#endif
|
||||
// expected-error@+2{{string bigger than buffer}}
|
||||
#endif
|
||||
EXPECT_FORTIFY_DEATH_STRUCT(strcpy(split.tiny_buffer, small_string));
|
||||
|
|
Loading…
Reference in a new issue