Orange C version 7.10.592026-05-18
本版更新集中在编译器、汇编器与构建工具三处。OMAKE 修复若干问题,并首次支持在 Linux 上运行;occ 源码树调整后编译明显提速,运行库完成重构,汇编启动文件 c0??? 不再需要,改由新增的 #pragma entrypoint 配合新 RTL 承担入口。
优化器把变量引用移出循环,重写活跃变量分析,参数压栈减少临时寄存器占用,栈帧更小,局部池让 new/delete 更快。同时修掉一批崩溃与错误代码生成:无参数运行、/? 崩溃、位域实参传参错误、初始化列表、数组名字修饰、SSE 与内联汇编的 call/jmp/ret、atomic 操作覆盖在用寄存器、虚基类下默认构造 shim 失效等。oasm 修复 pshufb 并补入 sha1 指令,列表文件恢复字节显示;构建侧新增 C++17 与 orc 的 CMake 支持,occil 兼容 .NET Core 9/10,工程升至 VS2026。
Orange C version 7.0.12024-05-19
本版编译器全面支持 C++17 与 C23(新增 #embed),标准库同步升级到 libcxx 17,并加入配套 intrinsics。MSIL 编译器改为基于 .NET core,用 64 位 MSVC 也能构建出正常工作的编译器;DOS32 等遗留 MS-DOS 支持与 COFF2IEEE 被移除,源码与构建流程重组,CI 会用 MSVC、GCC 做构建检查。
编译器本体的修复面很广:模板方面解决 lambda 丢失限定符与引用、实参推导、推迟实例化、protected/private 可见性等问题;union 的默认拷贝构造、全局与函数级 union、结构体返回值大小计算等代码生成缺陷被纠正;constexpr 函数与 auto 类型推断得到加强。此外还补上了 'extern inline'、枚举自动定宽、原始字符串解析、数值常量求值的顺序依赖、pair 赋给 tuple 等一批标准符合性与崩溃问题,命令行文档与 C++ 标准符合性检查同步更新。
Orange C-v6.73.12023-09-23
这是一次维护性版本,主要围绕 CMake 集成的持续推进,同时升级了项目内置的 sqlite3 合并源码到最新版本,解决调试信息文件中创建索引的 bug。
具体修复:olink 修复了类型信息对应的调试信息错误;occ 移除了插桩逻辑;另外解决了 lscrtl.dll 被多个模块同时调用时的若干问题,多模块共用场景下不再互相干扰。
Orange C-v6.72.42023-09-18
这是一次维护性发布,主要为推进 CMake 集成铺路,同时改进 GNU COBOL 编译器测试套件的兼容性,继续完善 C23 支持。版本号改回标准三位格式,不再沿用 Windows 惯用的四位方案(RC 资源文件除外)。
编译器 occ 新增 BitInt 等 C23 特性;修复了单命令行编译多文件时的后端错误、缓冲区过小引发的一系列问题,以及汇编编译、析构函数提前调用、函数名转指针后当数组用导致崩溃等 bug。优化器重写以改善内存占用,输出文件名含空格时也能正常生成静态库;static/extern const int 在结构体与命名空间中导出常量的处理更规范,declspec(export) 现可放在 struct 关键字之前。
omake 修正了命令行转义与多余空格问题。运行时库 rtl 修复了 getexecname()、stat 的 dst 标志、mkdir、memcmp 无符号比较、atexit 失效、异常处理分配尺寸错误等缺陷,分配器换回 dlea,并更新了 kernel32 导入记录。
Orange-C-v6.0.71.12023-08-11
本次更新以修 bug 和补测试为主:omake 崩溃明显减少,对 GNU make 的兼容性提升;编译器修掉一批问题,新增若干库函数,支持 DLL 延迟加载,C23 支持已开工。
occ 修复覆盖不少边角:匿名结构名在不同编译单元间不一致、long long 索引的 new[] 生成错误代码、debug 符号偶发崩溃、initializer list 与 lambda 结构化返回类型的一系列问题;另外 -D 参数含分号时失效、用引号包含 stdio.h 不生效、-D/-U 开关与参数之间不留空格也不行,这些都已修好。新增 attribute((constructor))、#pragma exit、gcc 风格栈金丝雀和基础运行时/堆检查。
工具链重写了启动代码与头文件风格,新增 --out-implib 和 --output-def,VS 解决方案也重新整理;构建迁移到 GitHub Actions(Linux 与 Windows 双平台),Travis CI、BCC32 与 RADSTUDIO 支持一并移除。
Orange C-v6.0.70.22023-06-25
Improvements to generated code, compiler speed
This version improves the generated code in terms of size and speed, and improves compile times. It also has various rewrites that improve maintainability.
Along the way there have been other bug fixes, as well as evaluating compilation of several new programs.
A list of changes follows:
* fix various problems with the builds
* adjust VC projects to use narrow character support
* fix bugs compiling with clang
* clean up some compiler warnings, clang/gcc
* fix to compile various problematic third-party packages
* occ: internal rewrites to improve the quality of source code/debugging experience
* occ: internal rewrites to not compile functions that aren't needed
* occ: internal rewrites to the inliner, for better code quality and faster optimization and less space used
* occ: speed up parser
occ: add COUNTER__ predefined preprocessor variable
occ: fix problems with VAARGS
* occ: fix preprocessor problem : macro arguments should be scanned for replacements before replacing the token
occ: allow alignof__ in C mode
* occ: add the gcc extension for statements in expressions
occ: fix Generic to work with typedefs
* occ: fix problems with generating wide characters strings on odd byte boundaries
* occ: optimize single element structures that can be stored in a register, to be returned in a register
* occ: improve line data at the beginning of a function
* occ: improve debug information within do-while blocks
* occ: optimize the object files a little bit
* occ: fix problems with -werror switch
* occ: fix problems with C++14 switch
* occ: clean up code generation for setne instructions
* occ: add -static switch to generate static library directly from command line
occ: fix various problems compiling invoke
* occ: fix various problems that were highlighted due to all the rewrites
* occ: inline destructors in debug mode
* occ: fix code generation bugs
* occ: clean up rtti accounting code generation
* occ: 'empty' destructors don't need to be called during wind down of stack from during throw/catch
* occ: fix some bugs with catch blocks being considered in an order other than the one presented in the source code
* occ: interleave various things like member ptr and atexit code generation with the function generation a little better
* occ: inline exception block creation/teardown, instead of calling library functions
* occ: rework how accessibility checks are done
* occ: standardize generation of vtabs: wherever the destructor is generated.
* occ: fix bug with atomic long long stores
* occ: fix optimizer bug where atomic-modify and store instructions could sometimes result in bad code
* occ: beginnings of support for C23
* occil: speed up code generation
* occil: fix problem with duplicate field definitions
* occil: fix problem where using a long as a shift count causes problems on windows 11
* occpr: clean up extraneous errors
* oasm: speed up assembler, and compiler back end
* omake: don't create an error when .PHONY targets are used
* omake: fix -j:0 not to crash omake
* omake: fix default to be -j:1
* omake: fix for lockup when a tool generated an error for -j > 1
rtl: add wchart to stdatomic.h
* rtl: get rid of compiler warnings that occurred when #including inttypes.h
* rtl: fix some problems with the windows headers
* rtl: fix some problems with wide character functions
* rtl: fix push/pop bug in dpmi.c
* rtl: fix some bugs in the exception handling library
* rtl: tag more functions for export
* rtl: fix various problems that caused lscrtl.dll not to work
Orange C-v6.0.62.22023-02-18
这版主要回应社区集中提交的缺陷报告。最重大的变化是 Windows 头文件全面换血:原先那套半残的头文件被弃用,改用 Pelles C 编译器自带的完整头文件,与之配套,#pragma pack 也扩展到支持 push/pop 写法。运行时库同样改动颇多——补齐了缺失的字符串、移位、堆操作及宽字符版本的 ANSI C 函数,引入 64 位 timet,修复 fstat、stat、宽字符文件 I/O 等问题,并通过延迟加载 GetLargePageMinimum 保住 Windows XP 兼容性。编译器 occ 修复了命令行通配符、优化器强度削弱等多处崩溃,新增 -funsigned-char、computed-goto 与 declspec(deprecated);工程整体迁移到 VS2022 Community,并提供模拟 GCC/AR 的包装脚本。
Orange C-v6.0.61.12022-09-09
本次版本以跑通 libcxx 自带测试为主要目标,过程中对 occ 的解析与代码生成做了大量修补:模板、constexpr、noexcept、初始化列表与名字修饰的缺陷得到修复,若干崩溃、递归结构体偏移、析构函数在短路表达式和参数中的求值问题也一并解决。函数类型判定、RTTI 表、atomic 代码生成、值初始化、isconstructible 等均有修正,局部静态变量改用线程安全的守卫并按更标准的方式销毁,C++ 模式下结构体按值返回也修好了。此外编译速度有所提升,汇编输出补上了反修饰名,支持 builtin_unreachable 与命令行 DLL。Omake 增加了更多兼容 C++ 的写法,并处理了并行 make 的若干问题。
Orange C-v6.0.51.22021-11-22
本次更新的重点有四项:新增对 constexpr 函数求值的支持,补齐 libcxx 测试中 algorithm 部分,支持免费的 Embarcadero 编译器,并修复 VS2022 静态分析器的若干问题。
编译器核心(occ)的修复较为密集,集中在模板与重载解析上:重载函数的实参查找、模板实参匹配(含 nullptr、指针与数组)、isconstructible 在构造函数不可访问时应返回 false、以及 std::min/max/minmax、initializerlist、pow 复数版本的编译崩溃等。此外,非静态成员数据不再允许 constexpr,重复定义报错会显示前一处位置,调试标志由 /v 改为 /g,/v 改为输出版本信息;同时新增 /Wall、/W4 风格选项、gnu make 的长选项兼容,以及打印编译器信息的 gcc 风格参数。
orc 可解析 C 风格类型、枚举与函数原型;ocpp 支持依赖文件生成;omake 允许在命令行临时指定变量。运行库方面,fwrite 在长度为 1 时跳过除法、stdout 与 stderr 改为缓冲输出以提升速度,并补充了若干头文件兼容宏与接口。CI 升级到 VS2019,仓库也清掉了一批死代码。
Orange C-v6.0.50.12021-07-16
occ 这版把 libcxx 升到 10,面向 C++14 编译器,标准库补齐原子操作与线程支持,另加了一批新的 C RTL 函数。
编译器修的多是影响正确性的坑:默认析构函数没按需提升为 virtual、虚析构调用不全、(double)aa = value 偶发失效、fastcall 在优化代码下出错、packed 模板与 auto 推导的若干错漏,以及用 CLANG 10 以上编译 occ 自身会失败。新增 -LINK、-DLL 命令行开关、asm 关键字与 #includenext,重写了类型别名,仅返回类型不同的模板重载也能正确处理,报错补上「referenced from」层级。
链接侧修掉了汇编 jmp [eax] 把寄存器截断成字长的问题,共享内存映射重写以省资源,代码段填充改用 nop。工程升级到 VS2019,构建去掉重复重建、失败能正常报错,帮助文本过长时改为按页提示。