You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was very confused at first but this makes sense in the end - take this with a grain of salt, my knowledge about C is very limited. It is important to note that
typedefenum Anonymous {
A,
B
} TypeExport __attribute__((mode(__word__)));
and
typedefenum Anonymous {
A,
B
} __attribute__((mode(__word__))) TypeExport;
appear to be different: In the first case the attribute (__attribute__((mode(__word__))) means "size of the type is a machine word") only applies to the typedef TypeExport, while in the second case the attribute applies directly to enum Anonymous and then transitively to TypeExport. I confirmed that by looking at LLVM output from two different clang versions (windows and ubuntu). See the following example output.
I would wish that annotating an attribute on the typedef would be forbidded in C and users would have to apply attributes to the enumeration itself, but this appears to be legal so bindgen should be able to handle that correctly.
The text was updated successfully, but these errors were encountered:
Bindgen version
0.69.4
infers name for anonymous enumeration from its typedef, even if the typedef and enumerations are different.Input C/C++ Header
Bindgen Invocation
Actual Results
Expected Results
Additional information
I was very confused at first but this makes sense in the end - take this with a grain of salt, my knowledge about C is very limited. It is important to note that
and
appear to be different: In the first case the attribute (
__attribute__((mode(__word__)))
means "size of the type is a machine word") only applies to the typedefTypeExport
, while in the second case the attribute applies directly toenum Anonymous
and then transitively toTypeExport
. I confirmed that by looking at LLVM output from two different clang versions (windows and ubuntu). See the following example output.Ubuntu LLVM output
I would wish that annotating an attribute on the typedef would be forbidded in C and users would have to apply attributes to the enumeration itself, but this appears to be legal so bindgen should be able to handle that correctly.
The text was updated successfully, but these errors were encountered: