Re: Using __attribute((packed))__ on picky architectures

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

 



On Fri, Jan 16, 2009 at 10:59 AM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:

>> Then why is attribute((packed)) provided?  I really don't see a use
>> for it.  Why not rename it to __attribute__((addressviolation))?
>
> The potential address violation only occurs when you take the address
> of a field and pass it to another function.  There are many ways to
> use structures without taking the address of a field.

So my example

    handle(&t.field2);

has the potential to create an address violation, but these
assignments do not(?):

   t.field2 = <some value>
   t->field2 = <some value>

Thanks,
Darren

[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