Skip to content

Generating code that will not compile #46

@russel

Description

@russel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions