linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <jes@trained-monkey.org>
To: Khem Raj <raj.khem@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: [PATCH] Define alignof using _Alignof when using C11 or newer
Date: Sun, 19 Mar 2023 12:16:40 -0400	[thread overview]
Message-ID: <8bf3b89c-83bd-8ba5-d3ab-cf17c6745e72@trained-monkey.org> (raw)
In-Reply-To: <20230118083236.24418-1-raj.khem@gmail.com>

On 1/18/23 03:32, Khem Raj wrote:
> WG14 N2350 made very clear that it is an UB having type definitions
> within "offsetof" [1]. This patch enhances the implementation of macro
> alignof_slot to use builtin "_Alignof" to avoid undefined behavior on
> when using std=c11 or newer
> 
> clang 16+ has started to flag this [2]
> 
> Fixes build when using -std >= gnu11 and using clang16+
> 
> Older compilers gcc < 4.9 or clang < 8 has buggy _Alignof even though it
> may support C11, exclude those compilers too
> 
> [1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm
> [2] https://reviews.llvm.org/D133574
> 
> Upstream-Status: Pending
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  sha1.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

Applied,

Thanks,
Jes



      reply	other threads:[~2023-03-19 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18  8:32 [PATCH] Define alignof using _Alignof when using C11 or newer Khem Raj
2023-03-19 16:16 ` Jes Sorensen [this message]

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=8bf3b89c-83bd-8ba5-d3ab-cf17c6745e72@trained-monkey.org \
    --to=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=raj.khem@gmail.com \
    /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: link
Be 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 NNTP newsgroup(s).