[M3devel] a trouble with passing records by value..

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Wed Sep 1 17:29:27 CEST 2010


On Wed, Sep 01, 2010 at 11:41:20AM +0000, Jay K wrote:
> 
> Hm. So now I've started asserting that the backend and frontend agree on the sizes of records.
> They don't.
> 
> I think we should probably
>   - not call layout_type 
>   - be sure to pass size/align to backend, and have it just set the values, if the rest of the
>     backend is ok with that.
> 
> e.g.  m3cg_declare_field and m3cg_declare_record don't take an alignment.
> 
> Though it is easy to compute at this point -- integers/floats/pointers are aligned on their size
> and records are aligned on the highest alignment among their members.

I seem to remember an exception on one of the old IBM "workstations".  
Its structires were 32-bit aligned (and its 64-bit floats were 32-bit 
aligned *except* that structures whose first actual field was a 64-bit 
float had to be 64-bit aligned.  "First actual field" meancould mean the 
first field of the first field of the first field of ... of the first 
field.  I've never figured out the reason for that crazy rule.  long 
floats anywhere else in the structure didn't matter.

Let's hope you don't have to be copatible with *that* C compiler!

-- hendrik

> 
> I have to poke around more. I'm going to disable this code again.
> 
>  - Jay
> 



More information about the M3devel mailing list