public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* question on use of aligned attribute in a structure definition
@ 2005-06-17 17:39 Eric Sandeen
  0 siblings, 0 replies; only message in thread
From: Eric Sandeen @ 2005-06-17 17:39 UTC (permalink / raw)
  To: gcc-help

The method that I have always seen for defining an aligned member of a 
structure is something like this:

struct foo {
	int bar;
	uint64_t baz __attribute__((aligned(8)));
}

but I'm wondering if this is valid as well:

struct foo {
	int bar;
	uint64_t __attribute__((aligned(8))) baz;
}

I ask because of macro hell I'm dealing with in an existing codebase, where the 
latter format would fit the existing implementation of this particular 
codebase, IF it results in the same alignment for structure member "baz"...

Thanks,

-Eric

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-06-17 17:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-17 17:39 question on use of aligned attribute in a structure definition Eric Sandeen

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