Bitfields are not translated

Open
#312 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp, rust
Domain
compilers

Research direction

The issue names no files or functions, so start by finding where the converter handles C++ struct fields and where it falls back to a u32 for bitfield declarations. Reproduce with a small struct containing unsigned flags : 3 and inspect the generated Rust. Done means the output preserves the bit width and the struct's size and layout match the C++ original; the issue doesn't say which test to extend, so check the existing struct tests first.

Written by the indexing model from the issue text.

Description

The converter ignores unsigned flags : 3 and instead generated a u32 which breaks struct layout.

Dominant language
Rust
Stars
310
Forks
18
Avg merge
10h 18m
Merged PRs (30d)
125

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Cpp2Rust/cpp2rust

All issues in Cpp2Rust/cpp2rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.