Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix casting issues (missing func_vt in riscvgen.c):
When compiling a file like: long cast_charp_to_long (char const *i) { return (long)i; } long cast_int_to_long (int i) { return (long)i; } long cast_voidp_to_long (void const *i) { return (long)i; } void main(int argc, char* argv[]){ unsigned long a = 19; char b = a; return; } We had this error message: cannot cast from/to void It happened because the return type of the functions (`func_vt`) was not set properly by `riscv-gen.c` and it was VT_VOID by default. In the `mob` branch they moved all this code to `tccgen.c` to avoid repeating it in every single architecture, but that made me miss it during the backport of the RISC-V backend. This commit adds that piece of code but there might be more places where a similar thing happens.
- Loading branch information