-
Notifications
You must be signed in to change notification settings - Fork 38
Generating code that will not compile #46
Copy link
Copy link
Closed
Description
This is a one off case but…
The C code:
struct dtv_property {
*u32 cmd;
__u32 reserved[3];
union {
__u32 data;
struct dtv_fe_stats st;
struct {
__u8 data[32];
__u32 len;
__u32 reserved1[3];
void reserved2;
} buffer;
} u;
int result;
} __attribute ((packed));
results in the D code:
struct dtv_property
{
__u32 cmd;
__u32[3] reserved;
union
{
__u32 data;
struct dtv_fe_stats
{
__u8 len;
dtv_stats[4] stat;
}
dtv_fe_stats st;
struct
{
__u8[32] data;
__u32 len;
__u32[3] reserved1;
void* reserved2;
}
}
int result;
}
which is compile error not only because of the __u32 and __u8 types, but because of the field data in the anonymous struct.
I do not have any answers, but I think this marker for the problems needs to be put on record.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels