linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: linux-sparse@vger.kernel.org
Subject: typedefs and alignment
Date: Mon, 8 Feb 2010 13:35:55 +0300	[thread overview]
Message-ID: <20100208103501.GA14210@bicker> (raw)

I've found an issue handling typedefs and alignment.  In the appended 
code sparse things 'ptr' has to be aligned so the size of 'bar' is 1024.
I haven't looked at how to fix this at all, I thought I would ask the
experts for hints first.

regards,
dan carpenter

#include <stdio.h>

typedef struct aligned_struct {
	int a;
}  __attribute__ ((aligned(1024))) ali_t;

struct foo {
	int b;
	ali_t *ptr;
};

int mainx(void)
{
	struct foo bar;

	printf("%d\n", sizeof(bar));
	return 0;
}

             reply	other threads:[~2010-02-08 10:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 10:35 Dan Carpenter [this message]
2010-02-10  1:36 ` typedefs and alignment Christopher Li
2010-02-10  9:46 ` Chris Li
2010-02-10 10:11   ` Dan Carpenter

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=20100208103501.GA14210@bicker \
    --to=error27@gmail.com \
    --cc=linux-sparse@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;
as well as URLs for NNTP newsgroup(s).