linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* typedefs and alignment
@ 2010-02-08 10:35 Dan Carpenter
  2010-02-10  1:36 ` Christopher Li
  2010-02-10  9:46 ` Chris Li
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-02-08 10:35 UTC (permalink / raw)
  To: linux-sparse

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;
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-10 10:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-08 10:35 typedefs and alignment Dan Carpenter
2010-02-10  1:36 ` Christopher Li
2010-02-10  9:46 ` Chris Li
2010-02-10 10:11   ` Dan Carpenter

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).