From: Dan Carpenter <dan.carpenter@oracle.com>
To: John Levon <levon@movementarian.org>
Cc: smatch@vger.kernel.org, andy@omniosce.org, linux-sparse@vger.kernel.org
Subject: Re: Packed struct size issue
Date: Thu, 18 Jul 2019 13:50:35 +0300 [thread overview]
Message-ID: <20190718105035.GE3111@kadam> (raw)
In-Reply-To: <20190717134234.GA5551@movementarian.org>
[ resending to the correct Sparse email address ].
On Wed, Jul 17, 2019 at 02:42:34PM +0100, John Levon wrote:
>
> Andy Fiddaman discovered:
>
> $ cat ./test.c
> #include <stdio.h>
> #include <stdint.h>
>
> struct t1 {
> uint8_t critical_warning;
> uint16_t temperature;
> uint8_t available_spare;
> } __packed;
>
> _Static_assert(sizeof(struct t1) == 4, "bad size for t1");
>
I've added Sparse mailing list to the CC.
It looks like the packed attribute is broken on upstream Sparse (from
April) as well and I would prefer if they fixed it and I pulled in their
fix. It's probably better to use __attribute__((packed)) instead of the
__packed macro in the test code.
regards,
dan carpenter
prev parent reply other threads:[~2019-07-18 10:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-17 13:42 Packed struct size issue John Levon
2019-07-18 10:16 ` Dan Carpenter
2019-07-18 10:50 ` Dan Carpenter [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=20190718105035.GE3111@kadam \
--to=dan.carpenter@oracle.com \
--cc=andy@omniosce.org \
--cc=levon@movementarian.org \
--cc=linux-sparse@vger.kernel.org \
--cc=smatch@vger.kernel.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: 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