linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: 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>,
	James Hogan <james.hogan@imgtec.com>
Subject: Re: [PATCH V2] sparse: Allow override of sizeof(bool) warning
Date: Thu, 27 Feb 2014 19:10:04 +0300	[thread overview]
Message-ID: <20140227161004.GT26722@mwanda> (raw)
In-Reply-To: <530F5E53.5070208@zytor.com>

On Thu, Feb 27, 2014 at 07:48:35AM -0800, H. Peter Anvin wrote:
> > Do we have a fairly comprehensive list of what these extrastandard
> > requirements / assumptions are?  It might be a good idea to have one
> > that we can point to, so that (a) people who are trying to define a
> > new architecture knows what they need to handle, (b) and so we can
> > give a list of things that static code analyzers like smatch and
> > coverity and sparse should be able to suppress (perhaps in a Linux
> > kernel-only mode).
> > 
> 
> No, but I think we can certainly make a list... a lot of it right now
> sits in various people's heads.
> 
> Here are a couple:
> 
> - Bytes are 8 bits
> - Signed integers will be 2's complement
> - sizeof char, short, int, long, and long long will be 1, 2, 4, 4, 8 or
>   1, 2, 4, 8, 8 on 32- and 64-bit processors, respectively.
> - sizeof(long) == sizeof(void *)
> - NULL is represented by all zero
> - Structures will not add padding as long as all the members are
>   naturally aligned.
> 

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.

regards,
dan carpenter


  parent reply	other threads:[~2014-02-27 16:11 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <530E6F76.1070605@zytor.com>
     [not found] ` <1393462087.24588.50.camel@joe-AO722>
     [not found]   ` <530E8C2E.7080307@zytor.com>
2014-02-27  2:03     ` [PATCH] sparse: Allow override of sizeof(bool) warning Joe Perches
2014-02-27  2:28       ` 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 [this message]
2014-02-27 16:52                             ` H. Peter Anvin
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

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=20140227161004.GT26722@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=blp@nicira.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=james.hogan@imgtec.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 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).