Struct typedef is not generated
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
No source file or test is named. Start by tracing how cheadergen handles standalone #[repr(C)] structs versus structs used in function signatures; compare the expected Foo typedef, visibility naming, and #[repr(Rust)] extern-struct behavior, then add coverage for the requested outcomes.
Written by the indexing model from the issue text.
Description
After #24, I was able to use cheadergen with CO2 (thanks!), and immediately noticed this:
#[repr(C)]
struct Foo {
x: i32,
y: i32,
}
Expected output:
typedef struct Foo {
int32_t x;
int32_t y;
} Foo;
Found:
// Empty file with some includes
The Foo will appear if I use it in a function signature, and will appear as extern struct (typedef struct Foo Foo) if I use it behind a pointer in a signature, so it might be intentional, but I would argue that cheadergen should always emit full struct definitions for #[repr(C)] pub structs, for public field it should use name and for private field it should use __name, and for #[repr(Rust)] structs it should emit an extern struct. What do you think?
- Dominant language
- Rust
- Stars
- 34
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LukeMathWalker/cheadergen
-
Use as a library? Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
LukeMathWalker/cheadergen#34 ·
-
add --check mode Open
Difficulty 3/5 1-2 days Newbie friendliness 67/100
LukeMathWalker/cheadergen#28 · 1 reaction ·
-
diagnostics
Difficulty 4/5 3-5 days Newbie friendliness 55/100
LukeMathWalker/cheadergen#27 · 3 comments ·
All issues in LukeMathWalker/cheadergen
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100