[C2hs] sizeof hook calculates the wrong size

Manuel M T Chakravarty chak at cse.unsw.edu.au
Wed May 24 12:10:20 EDT 2006


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




More information about the C2hs mailing list