diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-07-27 15:55:42 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-04-17 16:12:41 -0300 |
commit | 0f38a02254077d5bd42c3f88ccaef10e733a76e2 (patch) | |
tree | 7a0c75e846b5b98ef1fe1eb645bff3591eb492ee | |
parent | 4fbc210a64404d78059759eb58cdaeda78d3d2fd (diff) | |
download | glibc-0f38a02254077d5bd42c3f88ccaef10e733a76e2.zip glibc-0f38a02254077d5bd42c3f88ccaef10e733a76e2.tar.gz glibc-0f38a02254077d5bd42c3f88ccaef10e733a76e2.tar.bz2 |
malloc: Suppress clang warning on tst-aligned-alloc
-rw-r--r-- | malloc/tst-aligned-alloc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/malloc/tst-aligned-alloc.c b/malloc/tst-aligned-alloc.c index 91167d1..b05be95 100644 --- a/malloc/tst-aligned-alloc.c +++ b/malloc/tst-aligned-alloc.c @@ -55,18 +55,31 @@ do_test (void) if (p2 == NULL) FAIL_EXIT1 ("aligned_alloc(1, 64) failed"); + /* clang warns that alignment is not a power of 2, which is what the + test means to do. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (18.0, "-Wnon-power-of-two-alignment"); p3 = aligned_alloc (65, 64); + DIAG_POP_NEEDS_COMMENT_CLANG; if (p3 != NULL) FAIL_EXIT1 ("aligned_alloc(65, 64) did not fail"); + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (18.0, "-Wnon-power-of-two-alignment"); p4 = aligned_alloc (0, 64); + DIAG_POP_NEEDS_COMMENT_CLANG; if (p4 != NULL) FAIL_EXIT1 ("aligned_alloc(0, 64) did not fail"); + /* clang warns that alignment must be 4294967296 or smaller, which is + what the test means to do. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (18.0, "-Wbuiltin-assume-aligned-alignment"); /* This is an alignment like 0x80000000...UL */ p5 = aligned_alloc (SIZE_MAX / 2 + 1, 64); + DIAG_POP_NEEDS_COMMENT_CLANG; if (p5 != NULL) FAIL_EXIT1 ("aligned_alloc(SIZE_MAX/2+1, 64) did not fail"); |