Issue 17 in ctypesgen: Failed to parse real anonymous field in struct.

0 views
Skip to first unread message

codesite...@google.com

unread,
Jun 24, 2011, 10:47:16 AM6/24/11
to ctyp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 17 by mozbug...@gmail.com: Failed to parse real anonymous field
in struct.
http://code.google.com/p/ctypesgen/issues/detail?id=17

For code like this:

typedef struct SteamState_struct{
char region;
union{
int R1;
long int R4;
float R2;
double R3;
};
} SteamState;

the union part will be discarded. If I give the union a name like 'rvalue',
the union will be generated properly.

The same is true for anonymous enum inside struct.

ctypes Structure class has a special attribute for _anonymous_.

codesite...@google.com

unread,
Feb 17, 2012, 4:24:03 AM2/17/12
to ctyp...@googlegroups.com

Comment #1 on issue 17 by mozbug...@gmail.com: Failed to parse real

This seems to be a C11 feature. Before C11, it's a gcc extension.

Attached patch make the anonymous fields available. anonymous field will
have its name as `null` in json.

Attachments:
ctypesgen-anonymous-field.patch 3.2 KB

codesite...@google.com

unread,
Feb 17, 2012, 6:42:28 AM2/17/12
to ctyp...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 17 by r...@sc3d.org: Failed to parse real anonymous

Thanks; committed.

Reply all
Reply to author
Forward
0 new messages