ctest: Support flexible array members
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 1.3k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 69
Description
C's "flexible array members" are basically a convenient way to access a properly-aligned pointer to data after the struct:
struct s {
int len;
int data[];
};
In Rust we typically do:
struct S {
len: c_int,
data: [c_int; 0],
}
We have a handful of tests that are related to FAM not being supported, e.g. https://github.com/rust-lang/libc/blob/93a17ee8f6cb91cd73dbfd7c5bad88f67dc16164/libc-test/build.rs#L5338-L5345. I think this should be pretty easy to start supporting.
Cc of course @mbyx
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
Start in libc-test/build.rs around lines 5338-5345, then inspect the other tests related to flexible array members not being supported. Trace how ctest handles the Rust representation of C flexible array members and update that support. Done means the relevant libc tests recognize the shown zero-length-array pattern and pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 66/100