Re: Does __attribute__((__packed__)) aplies to types or variables?

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

 



On Thu, Oct 22, 2015 at 02:18:47PM -0200, Daniel. wrote:
> I mean that packed attribute is applied only when allocation is
> implied or can I apply packed
> attribute to struct definitions where no variables are declared?

Yes, it applies to the type.

> struct __attribute__((__packed__)) foo { ... };
> struct foo bar; <--- is this packed?

Compare sizeof(struct foo) with sizeof(bar) to find out yourself.

Cheers, Phil
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux