freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: misalignment with DEC Unix.


From: Tom Kacvinsky
Subject: Re: misalignment with DEC Unix.
Date: Tue, 27 Jun 2000 14:30:35 -0400 (EDT)

> 
> I'm a bit surprised by this. Are you really sure that you can have
> both 4-byte aligned variables and 8-bytes aligned *only* pointers ?
> 
> Could you give us the output of the following C program:
> 
>   #include <stdio.h>
> 
>   short a[3];
> 
>   int  main( void )
>   {
>     printf( "%p %p %p %p %d\n", a, a+1, (void*)(a+1), a+2, sizeof(a) );
>   }
> 
> It would help me see things clearer..
> 

140000190 140000192 140000192 140000194 6

It would appear that I am mistaken.  If I change the short to char, I get this
output:

140000190 140000191 140000191 140000192 3 

Silly me.  But I know casting is one thnig that can cause mis-alignment.
I'll try to find an example...

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]