sizeof hook calculates the wrong size

Hello
The sizeof hook calculates the size wrong in this example:
-----------------------------------------------------------------
main = putStrLn (show {# sizeof loop_info64_t #})
#c
#include

Volker,
----------------------------------------------------------------- struct loop_info64 { __u64 lo_device; /* ioctl r/o */ __u64 lo_inode; /* ioctl r/o */ __u64 lo_rdevice; /* ioctl r/o */ __u64 lo_offset; __u64 lo_sizelimit;/* bytes, 0 == max available */ __u32 lo_number; /* ioctl r/o */ __u32 lo_encrypt_type; __u32 lo_encrypt_key_size; /* ioctl w/o */ __u32 lo_flags; /* ioctl r/o */ __u8 lo_file_name[LO_NAME_SIZE]; __u8 lo_crypt_name[LO_NAME_SIZE]; __u8 lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */ __u64 lo_init[2]; }; -----------------------------------------------------------------
It looks like the the arrays are mistaken for pointers.
This has been fixed in the version in darcs now.
There's another small bug. If you reorder main and the C block in the example above, such that "#c" is the first line, then you get a parse error.
We are currently talking about the right way to fix this. Cheers, Manuel
participants (2)
-
Manuel M T Chakravarty
-
Volker Wysk