public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] malloc: Suppress clang warning on tst-aligned-alloc Date: Mon, 29 Jan 2024 18:02:06 +0000 (GMT) [thread overview] Message-ID: <20240129180206.ACC4C385840D@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c50d0c20744faa68e4a81a2a1e1b630668b6eeb7 commit c50d0c20744faa68e4a81a2a1e1b630668b6eeb7 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Thu Jul 27 15:55:42 2023 -0300 malloc: Suppress clang warning on tst-aligned-alloc Diff: --- malloc/tst-aligned-alloc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/malloc/tst-aligned-alloc.c b/malloc/tst-aligned-alloc.c index 91167d1392..b05be95a89 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");
next reply other threads:[~2024-01-29 18:02 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-01-29 18:02 Adhemerval Zanella [this message] -- strict thread matches above, loose matches on Subject: below -- 2024-04-17 20:12 Adhemerval Zanella 2024-04-02 15:58 Adhemerval Zanella 2024-02-09 17:36 Adhemerval Zanella 2024-02-07 14:11 Adhemerval Zanella 2023-12-21 18:58 Adhemerval Zanella 2023-09-28 17:56 Adhemerval Zanella 2023-08-30 12:43 Adhemerval Zanella
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240129180206.ACC4C385840D@sourceware.org \ --to=azanella@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).