tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
14.72k stars 858 forks source link

Cgo doesn't support bitshifted constants #4285

Closed hectorchu closed 1 week ago

hectorchu commented 3 weeks ago

If I change the #define foo 3 to #define foo (3 << 0) in cgo/testdata/const.go, the test fails with testdata/const.go:4:17: unexpected token ILLEGAL, expected end of expression.

aykevl commented 3 weeks ago

Thank you for the report! I have created a PR to fix this: https://github.com/tinygo-org/tinygo/pull/4286

deadprogram commented 1 week ago

This was released with v0.32.0 so now closing. Thank you everyone!