antoinealb / rust-demo-cortex-m4

A simple blinking LED project based on Rust, for fun
Other
62 stars 9 forks source link

hard float: wrong argument type #4

Open msplr opened 9 years ago

msplr commented 9 years ago

In LM4F_startup.c you should add a C declaration for the function rust_float_test to tell the C compiler what argument type is expected. (something like float rust_float_test(float);)

This prevents GCC from assuming double as the default argument type, leading to the following incorrect function call:

vldr        d0, [pc, #28]    ; 300 <rst_handler+0x68>
bl          34c <rust_float_test>