GNOME Bugzilla – Bug 766011
Support anonymous structs in scanner
Last modified: 2016-05-08 22:04:28 UTC
Anonymous structs can be useful when used in conjunction with anonymous unions.
Created attachment 327321 [details] [review] [PATCH 1/2] giscanner.ast: return only self.name as c_name if namespace is None
Created attachment 327322 [details] [PATCH 2/2] tests: add regression test for anonymous struct
Created attachment 327323 [details] [review] [PATCH 2/2] tests: add regression test for anonymous struct
The fix in patch 1 might be the wrong way to approach the problem here, I'm not too familiar with the codebase yet. The problem seems to be no struct-within-struct declarations have a namespace set, but for named structs the ctype gets set to the member name and so things work. Anonymous structs have neither a namespace nor a member name set in ctype so things don't work.
Is it really that easy? Hm...I think I recall the main issue here was nesting. Looks like the last commit in this area was https://git.gnome.org/browse/gobject-introspection/commit/?id=6b44b271fb27dc46175b58fbd7e1f36ac0419943 which has code that handles ast.Record too, we just didn't quite wire it up and test it I guess.