LukeMathWalker / LukeMathWalker/cheadergen
Struct typedef is not generated
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 34
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
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?
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.
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.
Assessment
- Tech stack
- c, rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100