You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run a simple floating point c code on pulpino but i am facing an issue where floats are not being printed.
here is the code that i am trying to run :
#include <stdio.h>
int main() {
float a =4.2;
float b = 3.1;
float c;
float d;
c = a+b ;
d = a-b ;
printf("Toplam=%f",c);
printf("Fark=%f",d );
return 0;
}
`error: implicit conversion from 'float' to 'double' when passing argument to function [-Werror=double-promotion]`
I understand that the error is originating because printf implicitly converts float to double when we use %f
after removing that flag even though the make is successful ,The floats are not visible . Previously only Toplam= was printed without the floats now i only see garbage characters no matter what i print `�Æ÷.`
If i remove all other flags and only keep the mfpdouble=float flag then i am getting `error: insn does not satisfy its constraints:
}
^
(insn 43 20 21 2 (set (reg:DF 14 a4)
(reg:DF 47 fa5 [orig:79 D.2575 ] [79])) /home/har/Downloads/pulpino/sw/apps/helloworld/helloworld.c:14 342 {*movdf_hardfloat_rv32}
(`
I have no clue where i am going wrong here would appreciate any help and advice on what direction i should take to solve this issue
The text was updated successfully, but these errors were encountered:
I am trying to run a simple floating point c code on pulpino but i am facing an issue where floats are not being printed.
here is the code that i am trying to run :
and here is my cmake configuration
I am using the https://github.com/pulp-platform/ri5cy_gnu_toolchain compiler with the FPU.
since i am adding the -Werror=double-promotion flag i am getting an error
I have no clue where i am going wrong here would appreciate any help and advice on what direction i should take to solve this issue
The text was updated successfully, but these errors were encountered: