tinyexpr icon indicating copy to clipboard operation
tinyexpr copied to clipboard

tinyexpr compilation fails on keil-mdk

Open xuziqianxin opened this issue 1 year ago • 0 comments

我的英语不太好所以下面一段是机翻 My English is not very good, so the following paragraph is a machine translation.

我再keil-MDK上面使用这个项目,非常好用,但是在编译的时候除了一些问题导致无法编译。 I use this project on keil-MDK, which is very easy to use, but it can't be compiled except for some problems during compilation.

然后我尝试修改了一些代码解决了这个问题。 Then I tried modifying some code to fix the issue.

首先,需要在tinyexpr.c 或 tinyexpr.h中添加 #pragma anon_unions 修复匿名联合体的问题。 First, you need to add #pragma anon_unions to tinyexpr.c or tinyexpr.h to fix the problem with anonymous unions.

接着需要对三处 te_fun2 t = s->function 修改,ARMCC不支持 void 赋值所以需要进行强制类型转换修改为 te_fun2 t = (te_fun2)s->function。 Then you need to modify the three te_fun2 t = s-> functions, ARMCC does not support void assignment, so you need to do a cast conversion to change it to te_fun2 t = (te_fun2)s->function.

然后问题就解决了。 Then the problem was solved.

xuziqianxin avatar Oct 22 '24 09:10 xuziqianxin