question on use of aligned attribute in a structure definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux