[C2hs] {# sizeof #} hook going wrong for cases of structs with
embeded arrays.
Manuel M T Chakravarty
chak at cse.unsw.edu.au
Fri May 12 21:23:25 EDT 2006
Udo Stenzel:
> Duncan Coutts wrote:
> [something bad about arrays embedded in structures]
>
> I just got bitten by the same bug. C2HS doesn't even attempt to
> calculate the size of arrays inside structures, so not only sizeOf hooks
> go wrong, but get and set hooks, too. My first call into libdb
> accordingly ended somewhere in the wilderness.
>
> Attached is my attempt at a fix. I'm not sure this is the most elegant
> way to go about it, but some limited testing shows it working.
Thanks again, Udo. I pushed the patch into the main repo.
> BTW, this comment at GenBind.hs line 1662 is no longer valid, isn't it?
>
> > -- * we make use of the assertion that `extractCompType' can only return a
> > -- `DefinedET' when the declaration is a pointer declaration
When else do you think DefinedET is produced?
Manuel
More information about the C2hs
mailing list