Re: Structure size directives



[Better choice for subject, would be "struct padding ..."]

jacob navia wrote:

Since standard C doesn't provide any way for the programmer to direct the compiler as to how to layout structures, most compilers provide some way to do this, albeit in different forms.

Most C compilers? Out of how many?


Unaligned accesses to objects, should be banned. It has nothing to do with portable C code, it might trigger a core dump on non-x86 CPU.

FYI, C++:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1262.pdf

--
Tor <bwzcab@xxxxxxxxx | tr i-za-h a-z>
.



Relevant Pages

  • Re: memcpy problem on PXA
    ... and I routinely deal with unaligned accesses, ... I very much doubt the compiler is using inline ... the library code for memcpy() ... the ultimate audio player for mobiles ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Coding embedded systems with C
    ... The only compiler ... > available for a given platform is a C-compiler. ... worse if long chain of descendents; memory allocation here and there if you ... Actually, albeit different from what you want, this ...
    (comp.lang.c)
  • Re: Alternative to MS Visual Studio for Linux?
    ... That one's for Windows (albeit using the GNU compiler). ...
    (uk.comp.os.linux)