2 Star 0 Fork 0

mirrors_ReneNyffenegger/dev-compiler-SubC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
BUGS 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
Jens Nyberg 提交于 2017-06-16 02:12 . import subc-20161212.tgz
UNRESOLVED BUGS
(1) Submitted by Quan Tran in 10/2015
Thanks a lot!
Dont miss his improved Go version of SubC at:
https://github.com/qeedquan/gosubc
The SubC bootstrap compiler generated by gcc/clang uses
4-byte int, so it will generate wrong code for x86_64
regarding numbers out of 4-byte range, so the asm will
mismatch against the compiler. However, the final scc built
from the scc0 and scc1 bootstrap will use 8-byte int on
x86_64, so that will be correct.
SubC does not support passing struct/unions as values, but it
allows you to declare it in function parameters, e.g.:
void f(struct foo x) {}
Switch statements may contain duplicate cases.
SubC allows externs in local declarations to be initialized:
void f() { extern int a = 10; } /* should not be allowed! */
SubC can only index arrays using indexes of int types, e.g.:
given
int a[10], b[2];
char x[10];
a[x[0]] does not work but a[b[0]] does work even though x[0]
does generate a valid integer index. Workaround: a[x[0]+0],
which will promote x[0] to int.
SubC currently allows any unary ops on any types, even on
structs: e.g.:
struct file f; !f;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_ReneNyffenegger/dev-compiler-SubC.git
git@gitee.com:mirrors_ReneNyffenegger/dev-compiler-SubC.git
mirrors_ReneNyffenegger
dev-compiler-SubC
dev-compiler-SubC
master

搜索帮助