Skip to content

Commit

Permalink
c2rust transpile: Allow any integral types in init lists, not just …
Browse files Browse the repository at this point in the history
…`char` and `int` (#1076)

* Fixes #1009.

This also fixes these errors in transpiling
[`nasa/cFS`](https://github.com/nasa/cFS).
  • Loading branch information
kkysen authored Apr 2, 2024
2 parents fb37a81 + 9c7ce66 commit 0e732f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c2rust-transpile/src/translator/literals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl<'c> Translation<'c> {
CTypeKind::Vector(CQualTypeId { ctype, .. }, len) => {
self.vector_list_initializer(ctx, ids, ctype, len)
}
CTypeKind::Char | CTypeKind::Int => {
ref kind if kind.is_integral_type() => {
let id = ids.first().unwrap();
self.convert_expr(ctx.used(), *id)
}
Expand Down

0 comments on commit 0e732f6

Please sign in to comment.