-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
triageRequires triageRequires triage
Description
hs-bindgen
offers selection by declaration name. For example, using the client option --select-by-decl-name
. We also offer to select declarations by name kind (I am not sure if this is documented anywhere). For example, to select all structures, one can run
(C) $ cabal run -- hs-bindgen-cli preprocess -I ./ select-test.h --select-by-decl-name struct
Now, if select-test.h
is
struct nested_outer_s {
struct {
int inner_member;
} nested_inner_s;
};
We get an error:
[Error ] [HsBindgen] [mangle-names] Missing declaration: 'struct nested_outer_s_nested_inner_s'; did you select the declaration?
This is because anonymous declarations are only matched against their name (prefixed with "anon:", which seems also pretty arbitrary). That is, we do not match against the name kind prefix.
In this case, the two strings we match against are:
"anon:nested_outer_s_nested_inner_s"
"struct nested_outer_s"
and only the second one gets selected. The first one is missing, as the error reports.
This may be a none-issue, but I think we should at least decide what we do in these cases.
Metadata
Metadata
Assignees
Labels
triageRequires triageRequires triage