Integer type sizes incorrectly handled on Linux
Open
Nobody has claimed this yet.
bug
PR Welcome
- Dominant language
- C#
- Stars
- 620
- Forks
- 79
- Avg merge
- 14h 27m
- Merged PRs (30d)
- 1
Description
Some platforms define 8-byte types like uint64_t as unsigned long int and causes CppAst to return CppPrimitiveType objects with the wrong byte size. A possible fix would be something like:
// Old
case CXTypeKind.CXType_ULong:
return CppPrimitiveType.UnsignedInt;
// New
case CXTypeKind.CXType_ULong:
return type.SizeOf == 8 ? CppPrimitiveType.UnsignedLongLong : CppPrimitiveType.UnsignedInt;
Contributor guide
No contributing guide indexed for this repository
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
Inspect src/CppAst/CppModelBuilder.cs around lines 1747-1770, starting with the CXType_ULong handling shown in the issue. Check how SizeOf maps Linux integer types to CppPrimitiveType values, and verify that an 8-byte uint64_t is reported with the correct primitive type and size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, csharp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100