Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一些语言特性不被Keil C51支持 #54

Open
slipperstree opened this issue Aug 2, 2021 · 6 comments
Open

一些语言特性不被Keil C51支持 #54

slipperstree opened this issue Aug 2, 2021 · 6 comments

Comments

@slipperstree
Copy link
Contributor

Keil的C编译器是基于C90的,所以有很多C99的特性不被支持导致无法编译。比如可变参数的宏定义 XXX(...) 等。
这导致51单片机全军覆没。有没有可能用一个开关来切换这些不被支持的语法,并最低限度的支持C51?

@armink
Copy link
Owner

armink commented Aug 2, 2021

暂时没有这个计划呢,C51 编译器可以选择 C99 模式吗

@slipperstree
Copy link
Contributor Author

不行,我试过了。但是据说第三方的SDCC支持,我没有试过,那个毕竟小众基本没什么人用。

@ifreecoding
Copy link

image

@slipperstree
Copy link
Contributor Author

slipperstree commented Nov 19, 2023

@ifreecoding
谢谢,但是你这个不是C51而是ArmM4的C编译器。Keil中C51的编译器是不支持C99 Mode的。

@cuimingyang
Copy link

@slipperstree 请问找到解决办法了,我现在将keil arm上的程序移植到keil c51,也是遇到这个问题

@slipperstree
Copy link
Contributor Author

@cuimingyang 没有什么好办法。如果你是刚需建议试试SDCC,工作量反而可能会少一些。C99的语法肯定是支持的。一些宏定义有特殊的格式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants