1. -g 调试信息 (DWARF5) - config.h 启用 CONFIG_DWARF_VERSION 5 - 生成 .debug_info/.debug_line/.debug_str 等现代调试节 - 函数/变量/行号信息完整 (GDB/VS Code 可调试) 2. 代码优化器验证 - 常量折叠: 2+3 → movl \ (编译期计算) - 死代码消除: if(0) 分支移除 - 不可达代码: i>1000 分支消除 - __OPTIMIZE__ 宏正确设置 3. C23 新特性 (-std=c2x/-std=c23) - __STDC_VERSION__ = 202311L - nullptr 关键字 + nullptr_t 类型 - typeof 泛型 (已有 GNU 扩展) 4. libpcc JIT 演示 (examples/jit_demo.c) - 运行时编译 C 代码字符串 - pcc_set_output_type(MEMORY) JIT 模式 - 调用宿主函数/访问宿主变量 - 验证: jit_run(10) 返回 55 5. VS Code 插件打包 - 修复 package.json 结构 (contributes 嵌套) - 生成 pcc-language-support-0.1.0.vsix (5.9 KB) - 语法高亮 + 构建/运行命令
46 行
1.2 KiB
C
46 行
1.2 KiB
C
#ifndef _STDDEF_H
|
|
#define _STDDEF_H
|
|
|
|
typedef __SIZE_TYPE__ size_t;
|
|
typedef __PTRDIFF_TYPE__ ssize_t;
|
|
typedef __WCHAR_TYPE__ wchar_t;
|
|
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
|
typedef __PTRDIFF_TYPE__ intptr_t;
|
|
typedef __SIZE_TYPE__ uintptr_t;
|
|
|
|
#if __STDC_VERSION__ >= 201112L
|
|
typedef union { long long __ll; long double __ld; } max_align_t;
|
|
#endif
|
|
|
|
#if __STDC_VERSION__ >= 202311L
|
|
/* C23: nullptr and nullptr_t */
|
|
typedef void *nullptr_t;
|
|
#define nullptr ((void*)0)
|
|
#endif
|
|
|
|
#ifndef NULL
|
|
#define NULL ((void*)0)
|
|
#endif
|
|
|
|
#undef offsetof
|
|
#define offsetof(type, field) __builtin_offsetof(type, field)
|
|
|
|
void *alloca(size_t size);
|
|
|
|
#endif
|
|
|
|
/* Older glibc require a wint_t from <stddef.h> (when requested
|
|
by __need_wint_t, as otherwise stddef.h isn't allowed to
|
|
define this type). Note that this must be outside the normal
|
|
_STDDEF_H guard, so that it works even when we've included the file
|
|
already (without requiring wint_t). Some other libs define _WINT_T
|
|
if they've already provided that type, so we can use that as guard.
|
|
PCC defines __WINT_TYPE__ for us. */
|
|
#if defined (__need_wint_t)
|
|
#ifndef _WINT_T
|
|
#define _WINT_T
|
|
typedef __WINT_TYPE__ wint_t;
|
|
#endif
|
|
#undef __need_wint_t
|
|
#endif
|