Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: sparse attribute packed on structures
Date: Wed, 16 Dec 2020 16:43:24 -0800	[thread overview]
Message-ID: <09a4e340-76d4-9ae3-ffe3-6e44706200ae@intel.com> (raw)
In-Reply-To: <20201216233021.qcnvgsup7efwanqs@ltop.local>



On 12/16/2020 3:30 PM, Luc Van Oostenryck wrote:
> On Tue, Dec 15, 2020 at 03:15:48PM -0800, Jacob Keller wrote:
>>
>> I did find one bug, in your step (3), you have a check against
>> info->packed on symbol.c:162 in lay_out_struct, but nothing ever set the
>> packed value. I think you just need to initialized info->packed from
>> sym_packed at the top of examine_struct_union_type, i.e.
> 
> A yes, I see, thank you. I think it was on purpose that it wasn't
> yet enabled (things are it fuzzy because the code is ~2 year old)
> and as I said it's unfinished.
> 
> But, with your change, does it handles 'packed' more or less
> correctly?
> 
> -- Luc
> 

Yes. Obviously we're limited in that we no longer check for
out-of-bounds accesses on bitfields, but it at least produces the
correct sizes for structures, and avoids the warnings that I was running
into.

Overall, I think the changes in that branch are solid, and look correct
to me.

I'm not sure what all the limitations are of having it produce incorrect
load/store operations that don't work with the packed bitfields.. but at
least for the code I was checking, it seems to be correct now.

Thanks,
Jake

  reply	other threads:[~2020-12-17  0:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 18:15 sparse attribute packed on structures Jacob Keller
2020-12-15 20:56 ` Luc Van Oostenryck
2020-12-15 22:17   ` Jacob Keller
2020-12-15 22:44   ` Jacob Keller
2020-12-15 23:15   ` Jacob Keller
2020-12-16 23:30     ` Luc Van Oostenryck
2020-12-17  0:43       ` Jacob Keller [this message]
2020-12-17  0:57         ` Luc Van Oostenryck

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=09a4e340-76d4-9ae3-ffe3-6e44706200ae@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@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