All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	"Theodore Ts'o" <tytso@mit.edu>, Borislav Petkov <bp@alien8.de>,
	Joe Perches <joe@perches.com>, Ben Pfaff <blp@nicira.com>,
	Christopher Li <sparse@chrisli.org>,
	Josh Triplett <josh@joshtriplett.org>,
	<linux-sparse@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2] sparse: Allow override of sizeof(bool) warning
Date: Thu, 27 Feb 2014 17:06:02 +0000	[thread overview]
Message-ID: <530F707A.8060603@imgtec.com> (raw)
In-Reply-To: <530F6D43.5020006@zytor.com>

On 27/02/14 16:52, H. Peter Anvin wrote:
> On 02/27/2014 08:10 AM, Dan Carpenter wrote:
>>
>> That last assumption has to change for the Meta architecture.
>>
>> https://lwn.net/Articles/522188/
>>
>> On meta, the structs and unions are padded to 4 bytes unless they are
>> explicitly marked as __packed.
>>
> 
> One have to wonder how likely they are to have that not continually break...

Well it's only when it deals with stored/portable data formats that it's
an issue, and in those cases some amount of care over packing has
usually already been taken. It most often causes problems when one small
struct/union containing only chars or shorts is nested inside another
struct which is marked as packed (on the unfortunately mistaken
assumption that the inner struct cannot have padding at the end so
doesn't need packing itself).

But yeh, it is a PITA.

Cheers
James

WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@imgtec.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Theodore Ts'o <tytso@mit.edu>, Borislav Petkov <bp@alien8.de>,
	Joe Perches <joe@perches.com>, Ben Pfaff <blp@nicira.com>,
	Christopher Li <sparse@chrisli.org>,
	Josh Triplett <josh@joshtriplett.org>,
	linux-sparse@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2] sparse: Allow override of sizeof(bool) warning
Date: Thu, 27 Feb 2014 17:06:02 +0000	[thread overview]
Message-ID: <530F707A.8060603@imgtec.com> (raw)
In-Reply-To: <530F6D43.5020006@zytor.com>

On 27/02/14 16:52, H. Peter Anvin wrote:
> On 02/27/2014 08:10 AM, Dan Carpenter wrote:
>>
>> That last assumption has to change for the Meta architecture.
>>
>> https://lwn.net/Articles/522188/
>>
>> On meta, the structs and unions are padded to 4 bytes unless they are
>> explicitly marked as __packed.
>>
> 
> One have to wonder how likely they are to have that not continually break...

Well it's only when it deals with stored/portable data formats that it's
an issue, and in those cases some amount of care over packing has
usually already been taken. It most often causes problems when one small
struct/union containing only chars or shorts is nested inside another
struct which is marked as packed (on the unfortunately mistaken
assumption that the inner struct cannot have padding at the end so
doesn't need packing itself).

But yeh, it is a PITA.

Cheers
James

  reply	other threads:[~2014-02-27 17:23 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 22:49 The sheer number of sparse warnings in the kernel H. Peter Anvin
2014-02-26 23:25 ` Borislav Petkov
2014-02-27  8:27   ` Richard Weinberger
2014-02-26 23:28 ` Greg KH
2014-02-26 23:29   ` Greg KH
2014-02-26 23:31     ` H. Peter Anvin
2014-02-26 23:37       ` H. Peter Anvin
2014-02-27  1:19         ` Josh Boyer
2014-02-27  1:21           ` H. Peter Anvin
2014-03-04 23:13       ` Valdis.Kletnieks
2014-02-27  0:11   ` H. Peter Anvin
2014-02-27  1:34     ` Greg KH
2014-02-27  2:09       ` Joe Perches
2014-02-27  3:15       ` Dave Jones
2014-02-27  4:32         ` Greg KH
2014-02-27 10:11       ` Guenter Roeck
2014-02-27  1:52     ` Peter Hurley
2014-02-27  4:19       ` H. Peter Anvin
2014-02-27  4:31         ` Greg KH
2014-02-27  9:22       ` Geert Uytterhoeven
2014-02-27  0:48 ` Joe Perches
2014-02-27  0:51   ` H. Peter Anvin
2014-02-27  1:06     ` Joe Perches
2014-02-27  1:33     ` [PATCH] err.h: Use bool for IS_ERR and IS_ERR_OR_NULL Joe Perches
2014-02-27  2:03     ` [PATCH] sparse: Allow override of sizeof(bool) warning Joe Perches
2014-02-27  2:08       ` [RFC PATCH] Makefile: sparse - don't check sizeof(bool) Joe Perches
2014-02-27  2:28       ` [PATCH] sparse: Allow override of sizeof(bool) warning Josh Triplett
2014-02-27  2:53         ` [PATCH V2] " Joe Perches
2014-02-27  2:58           ` Josh Triplett
2014-02-27  3:19             ` [PATCH V3] " Joe Perches
2014-02-27  3:29             ` [PATCH V2] " H. Peter Anvin
2014-02-27  3:38               ` Joe Perches
2014-02-27  3:42                 ` H. Peter Anvin
2014-02-27  8:25                   ` Borislav Petkov
2014-02-27 15:10                     ` H. Peter Anvin
2014-02-27 15:24                       ` Theodore Ts'o
2014-02-27 15:48                         ` H. Peter Anvin
2014-02-27 16:01                           ` Borislav Petkov
2014-02-27 16:10                           ` Dan Carpenter
2014-02-27 16:52                             ` H. Peter Anvin
2014-02-27 17:06                               ` James Hogan [this message]
2014-02-27 17:06                                 ` James Hogan
2014-02-27  4:00                 ` Ben Pfaff
2014-02-27  4:19                   ` H. Peter Anvin
2014-02-27  4:26                     ` Ben Pfaff
2014-02-27  4:32                       ` H. Peter Anvin
2014-02-27 20:22                         ` Christopher Li
2014-02-27 20:26                           ` H. Peter Anvin
2014-02-27 20:39                             ` Joe Perches
2014-02-27 20:55                               ` Christopher Li
2014-02-27 21:49                                 ` Joe Perches
2014-02-27 20:44                             ` Christopher Li
2014-02-27 21:00                               ` Joe Perches
2014-02-27 21:03                                 ` Christopher Li
2014-02-27 21:41                                 ` Christopher Li
2014-02-27  9:56 ` The sheer number of sparse warnings in the kernel Dr. David Alan Gilbert

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=530F707A.8060603@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=blp@nicira.com \
    --cc=bp@alien8.de \
    --cc=dan.carpenter@oracle.com \
    --cc=hpa@zytor.com \
    --cc=joe@perches.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.