Re: C programming on ARM



On 2008-01-30, Wilco Dijkstra <Wilco_dot_Dijkstra@xxxxxxxxxxxx> wrote:

Actually most architectures are byte addressable, including ARM,

True, but many of them (ARM, SPARC, MSP430, ...) have alignment
requirements for objects larger than 1 byte in size.

so casting pointers just works.

Unless the resulting pointer is misaligned.

Of course it's essential to know what you're doing - well
written programs rarely need pointer casts.

--
Grant Edwards grante Yow! It was a JOKE!!
at Get it?? I was receiving
visi.com messages from DAVID
LETTERMAN!! !
.



Relevant Pages

  • Re: C programming on ARM
    ... True, but many of them (ARM, SPARC, MSP430, ...) have alignment ... Byte addressability refers to the smallest unit of addressability, ... Unless the resulting pointer is misaligned. ...
    (comp.arch.embedded)
  • Re: realloc() implicit free() ?
    ... block size as a request for one byte, and let the alignment mechanisms raise it as they will. ... is therefore suitably aligned for any type (`struct s' in particular), the value can be assigned to any type of pointer, and can then be used to access an object of that type. ... of the Standard can distort its meaning. ...
    (comp.lang.c)
  • Re: struct and union alignment
    ... > a char object requires only 1-byte alignment. ... I see no reason to require same alignment for types void* and char*, ... (Alignment requirements for character types are discussed ... See for yourself: in both cases "pointer ...
    (comp.lang.c)
  • Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)
    ... pci_device's or device's probe was finished. ... Would that be a bug in the Sparc platform code? ... a NULL iommu pointer or something like that. ... subsystem doesn't get as far on sparc64 on 2.6.23 and 2.6.24. ...
    (Linux-Kernel)
  • Re: "free space" with declared type (alignment discussion)
    ... >>a function pointer member, a struct pointer member, and maybe a few ... > It doesn't put any extra constraint on alignment beyond this. ... > To assess actual alignment constraints, a structure might be used to figure how ...
    (comp.lang.c)