Re: Questions about alignment



Spiros Bousbouras wrote:
> Greetings
>
> A couple of questions:
>
> 1) If the address d is suitably aligned for datatype A then is it
> guaranteed that d+sizeof(A) will also be suitably aligned for A ?



>
> 2) If p is a pointer to some datatype B and contains a properly aligned
> address for B then does p+1 point to the next properly aligned address
> for B ?



Well, what you are doing is pretty much just the incrementation of the
pointer. Though I might add that it is not necessary for d or p to be
suitably aligned. The result is expected to be similar to that of
incrementation[++ or +=1] irrespective of the the address being aligned
or not.
--
comp.lang.c.moderated - moderation address: clcm@xxxxxxxxxxxx -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
.



Relevant Pages

  • Re: Questions about alignment
    ... If p is a pointer to some datatype B and contains a properly aligned ... PA-RISC LDCS and LDCWS instructions - they want a pointer-to-long (long ... have an appropriate newsgroups line in your header for your mail to be seen, ...
    (comp.lang.c.moderated)
  • Re: Questions about alignment
    ... d is presumably a pointer. ... >2) If p is a pointer to some datatype B and contains a properly aligned ... have an appropriate newsgroups line in your header for your mail to be seen, ...
    (comp.lang.c.moderated)
  • Re: Questions about alignment
    ... If "d is suitably aligned for datatype A", you can think of it as ... Yes, the terms here aren't strictly correct, as the pointer types ... int main(int argc, char *argv) ... have an appropriate newsgroups line in your header for your mail to be seen, ...
    (comp.lang.c.moderated)
  • Re: SSIS and unicode data types
    ... DT_BYREF_BOOL A pointer to a Boolean value. ... This data type is a 12-byte unsigned integer with a separate sign, a scale of 0 to 28, and a maximum precision of 29. ... In my package I happily took a DT_NTEXT attribute from Excel and converted it to a DT_WSTR datatype. ...
    (microsoft.public.sqlserver.dts)
  • Re: Pointers vs References: A Question on Style
    ... > in which you do not want to support exceptions (possibly due to ... > rule that if you have a pointer, ... //typedef someType * datatype; ...
    (comp.lang.cpp)