Linux-Sparse Archive mirror
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	linux-sparse@vger.kernel.org
Subject: Re: [PATCH v3 00/16] support __packed struct
Date: Thu, 31 Dec 2020 15:30:24 +0000	[thread overview]
Message-ID: <5c9945a4-f9bc-68a9-31f0-ae0958d06f84@ramsayjones.plus.com> (raw)
In-Reply-To: <20201231101034.59978-1-luc.vanoostenryck@gmail.com>



On 31/12/2020 10:10, Luc Van Oostenryck wrote:
> During parsing, Sparse recognizes the attribute 'packed' but this
> attribute is otherwise ignored for several reasons:
> 1) the attribute in 'struct __attr { ... }' is wrongly handled as
>    belonging to the whole declaration but it should belong to the type,
> 2) the attribute in 'struct <name> { ... } __attr;' is simply ignored,
> 3) the layout of packed bitfields need special care.
> 
> This series contains 2 parts:
> 1) handling of type attributes
> 2) correct layout of packed structs, including packed bitfields.
> 
> 
> This series is also available for review and testing at:
>   git://git.kernel.org/pub/scm/devel/sparse/sparse-dev.git packed-v3
> 
> 
> Changes since v2 (all thanks to Ramsay Jones):
> * correct several typos
> * add an explanation for one of the test
> * avoid sizeof() in tests where the size is constrained to some fixed value
> * remove a redundency in a test (struct sb identical to struct sa)
> * reformulate the commit message for apply_ctype()'s arguments reversal
> * tweak the not-so-1-to-1 code movement
> * fix the truncated commit message of the last patch

This all LGTM. Thanks!

ATB,
Ramsay Jones

> 
> Changes since v1:
> * fix layout of packed bitfields
> 
> 
> Luc Van Oostenryck (16):
>   add testcases for dubious enum values
>   add testcases for exotic enum values
>   add testcases for enum attributes
>   add testcases for type attributes
>   add testcases for packed structures
>   add testcases for packed bitfields
>   apply_ctype: use self-explanatory argument name
>   apply_ctype: reverse the order of arguments
>   apply_ctype: move up its declaration
>   struct-attr: prepare to handle attributes at the end of struct
>     definitions (1)
>   struct-attr: prepare to handle attributes at the end of struct
>     definitions (2)
>   struct-attr: prepare to handle attributes at the end of struct
>     definitions (3)
>   struct-attr: fix type attribute like 'struct __attr { ... }'
>   struct-attr: fix: do not ignore struct/union/enum type attributes
>   packed: no out-of-bound access of packed bitfields
>   packed: add support for __packed struct
> 
>  Documentation/TODO.md             |  3 --
>  linearize.c                       | 13 +++++-
>  parse.c                           | 78 ++++++++++++++++---------------
>  symbol.c                          | 12 +++--
>  symbol.h                          |  2 +
>  validation/enum-type-dubious.c    | 18 +++++++
>  validation/enum-type-exotic.c     | 28 +++++++++++
>  validation/packed-bitfield0.c     | 58 +++++++++++++++++++++++
>  validation/packed-bitfield1.c     | 27 +++++++++++
>  validation/packed-bitfield2.c     | 15 ++++++
>  validation/packed-bitfield3.c     | 28 +++++++++++
>  validation/packed-bitfield4.c     | 18 +++++++
>  validation/packed-bitfield5.c     | 20 ++++++++
>  validation/packed-deref0.c        | 23 +++++++++
>  validation/packed-struct.c        | 32 +++++++++++++
>  validation/parsing/enum-attr.c    | 29 ++++++++++++
>  validation/type-attribute-align.c | 19 ++++++++
>  validation/type-attribute-as.c    | 33 +++++++++++++
>  validation/type-attribute-mod.c   | 21 +++++++++
>  validation/type-attribute-qual.c  | 15 ++++++
>  20 files changed, 447 insertions(+), 45 deletions(-)
>  create mode 100644 validation/enum-type-dubious.c
>  create mode 100644 validation/enum-type-exotic.c
>  create mode 100644 validation/packed-bitfield0.c
>  create mode 100644 validation/packed-bitfield1.c
>  create mode 100644 validation/packed-bitfield2.c
>  create mode 100644 validation/packed-bitfield3.c
>  create mode 100644 validation/packed-bitfield4.c
>  create mode 100644 validation/packed-bitfield5.c
>  create mode 100644 validation/packed-deref0.c
>  create mode 100644 validation/packed-struct.c
>  create mode 100644 validation/parsing/enum-attr.c
>  create mode 100644 validation/type-attribute-align.c
>  create mode 100644 validation/type-attribute-as.c
>  create mode 100644 validation/type-attribute-mod.c
>  create mode 100644 validation/type-attribute-qual.c
> 

      parent reply	other threads:[~2020-12-31 15:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 10:10 [PATCH v3 00/16] support __packed struct Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 01/16] add testcases for dubious enum values Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 02/16] add testcases for exotic " Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 03/16] add testcases for enum attributes Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 04/16] add testcases for type attributes Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 05/16] add testcases for packed structures Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 06/16] add testcases for packed bitfields Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 07/16] apply_ctype: use self-explanatory argument name Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 08/16] apply_ctype: reverse the order of arguments Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 09/16] apply_ctype: move up its declaration Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 10/16] struct-attr: prepare to handle attributes at the end of struct definitions (1) Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 11/16] struct-attr: prepare to handle attributes at the end of struct definitions (2) Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 12/16] struct-attr: prepare to handle attributes at the end of struct definitions (3) Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 13/16] struct-attr: fix type attribute like 'struct __attr { ... }' Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 14/16] struct-attr: fix: do not ignore struct/union/enum type attributes Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 15/16] packed: no out-of-bound access of packed bitfields Luc Van Oostenryck
2020-12-31 10:10 ` [PATCH v3 16/16] packed: add support for __packed struct Luc Van Oostenryck
2020-12-31 15:30 ` Ramsay Jones [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=5c9945a4-f9bc-68a9-31f0-ae0958d06f84@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).