gen: fixes C warnings by appending U after unsigned integer literals (#6384)

pull/6390/head
Daniel Däschle 2020-09-16 14:50:41 +02:00 committed by GitHub
parent 5da698b4bf
commit 3a795e6d9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1963,6 +1963,10 @@ fn (mut g Gen) expr(node ast.Expr) {
// }
// g.write(')(')
g.expr(node.expr)
if node.expr is ast.IntegerLiteral &&
node.typ in [table.u64_type, table.u32_type, table.u16_type] {
g.write('U')
}
g.write('))')
}
}