Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/misc_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,12 @@ static void cjson_set_valuestring_should_return_null_if_strings_overlap(void)
/* The string passed to strcpy overlap which is not allowed.*/
str2 = cJSON_SetValuestring(obj, str);
/* If it overlaps, the string will be messed up.*/
#if defined(__GNUC__) && (__GNUC__ >= 16)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overread"
TEST_ASSERT_TRUE(strcmp(str, "bcde") == 0);
#pragma GCC diagnostic pop
#endif
TEST_ASSERT_NULL(str2);
cJSON_Delete(obj);
}
Expand Down