Re: char data[0]



Bill Reid wrote:

Chris Dollin <chris.dollin@xxxxxx> wrote in message
news:eglkil$v0b$1@xxxxxxxxxxxxxxxxxxxxxxx
Bill Reid wrote:

As I learned the hard way (reading the FAQ) last night, structs are
actually "self-aligned" (translation: "start at") "by their most
restrictive
member", meaning the largest type in the struct (or this is how I
understand it).

Which bit of the FAQ reads like that?

2.12, "Additional Links"->Eric Raymond post:

On modern 32-bit machines like the SPARC or the Intel [34]86, or
any Motorola chip from the 68020 up, each data iten must usually be
``self-aligned'', beginning on an address that is a multiple of its type
size.
Thus, 32-bit types must begin on a 32-bit boundary, 16-bit types on a
16-bit boundary, 8-bit types may begin anywhere, struct/array/union
types have the alignment of their most restrictive member.

---end of excerpt

So as I take it, compilers on most 32-bit machines today set up
struct alignment based on
the aligment of "their most restrictive member".

Padding bytes, enable member alignment
to be independant of struct alignment,
except for the first member.

--
pete
.



Relevant Pages

  • Re: char data[0]
    ... On modern 32-bit machines like the SPARC or the Intel 86, ... types have the alignment of their most restrictive member. ... compilers on most 32-bit machines today set up ... struct alignment based on the aligment of "their most restrictive member". ...
    (comp.lang.c)
  • Re: Too many groups problem
    ... Thanks for that response Mike, not quite what I wanted to hear, but at least ... project work, so if you happen to be senior manager, it is feasible that you ... end up being a member of a huge amount of groups, ... >> This only happens to those accounts, so i have ruled out the machines ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Simple way to how domain users log on as restricted users?
    ... This makes all members of Domain Users local restricted users. ... A restricted user is just an account that is a member of the local ... >>Make certain that the Domain Users group is a member ... >>> Just installed XP Pro machines in one of our labs. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Local Admins
    ... > Is there an easy way to scan 2K/XP machines to determine who is a member of ... > the administrator groups? ... > have over 1000 machines in our domain and I really don't want to try and run ... firewall security suite that prevent Web applications attacks, ...
    (Focus-Microsoft)
  • Re: Add additional domain group to local admins groups?
    ... but not be domain admins. ... If it's only about granting the rights for adding machines and accounts to ... simply have to select the group and add them under "This group is a member ...
    (microsoft.public.windows.group_policy)