Re: [Jack-Devel] JACK 1.9.10 to test (for 64/32 bits compatibility)

PrevNext  Index
DateMon, 07 Jan 2013 12:32:15 +0000
From John Emmas <[hidden] at tiscali dot co dot uk>
ToJACK Mailing List <[hidden] at lists dot jackaudio dot org>
In-Reply-ToPaul Davis Re: [Jack-Devel] JACK 1.9.10 to test (for 64/32 bits compatibility)
Follow-UpPaul Davis Re: [Jack-Devel] JACK 1.9.10 to test (for 64/32 bits compatibility)
On 7 Jan 2013, at 11:58, Paul Davis wrote:

> 
> I think that you (John) are missing the issue with alignment. It is not that gcc on ARM cannot implement single-byte packing. The problem is that the processor will raise an exception when attempting to load or store values when this alignment violates the rules for the processor.
> 

I understand what you're saying Paul but I'm afraid I can't agree - unless ARM is some kind of special case.  I can see your point about  __attribute__((packed)) meaning "I know what I'm doing" and I'm sure that used to be the case with older architectures but things have moved on.  Where a compiler supports struct packing (and at the point when the data needs to get presented to the CPU) it's the compiler's job to re-adjust the data as needed, to match the CPU's preferred alignment.  Of course, if the compiler can't handle that for some reason it should issue a warning, just like you said - but if the compiler simply presents misaligned data to the CPU, then the compiler doesn't really support packing.

For example, MSVC supports various packing arrangements and they all work - with the proviso that the structs are declared correctly.  There's no situation where the CPU accepts some packing arrangements but baulks with others.  It's the compiler's job to sort this out.

John
PrevNext  Index

1357561954.12537_0.ltw:2,a <A40909E6-254A-4155-9C41-F61FC77D0232 at tiscali dot co dot uk>