diff options
author | Jeremy Bettis <jbettis@google.com> | 2022-08-08 13:33:38 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-09 07:15:32 +0000 |
commit | f9964df8f9c41d776b153547da07cad8902e5ce4 (patch) | |
tree | 4078cc4eedbda23ac89a4b9d1ad203d800200a2a /test | |
parent | 7f5a3dfbb2de4474c76c13c5c2fccd9f1339e0f3 (diff) | |
download | chrome-ec-f9964df8f9c41d776b153547da07cad8902e5ce4.tar.gz |
ec: Fix test if build with clang
Add #ifdef around gcc only pragma
BRANCH=None
BUG=None
TEST=make test-coverage -j72 CC=clang
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: Ia14014ecb6ce912e86a1a673f97411d07318cd40
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3818126
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/stdlib.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/stdlib.c b/test/stdlib.c index 89ba90b54d..039e81a02d 100644 --- a/test/stdlib.c +++ b/test/stdlib.c @@ -128,7 +128,9 @@ static int test_strncpy(void) * string of length 12 [-Werror=stringop-truncation] */ #pragma GCC diagnostic push +#if defined(__GNUC__) && __GNUC__ >= 8 #pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif strncpy(dest, "testtesttest", 10); #pragma GCC diagnostic pop TEST_ASSERT_ARRAY_EQ("testtestte", dest, 10); |