工具/软件:TI C/C++编译器
以下代码不能使用 CGT 17.6.0.STS 编译(可能还有其他版本、我尚未选中)。
#define CONCATENATE ( a, b) a ##b
float A =+0x1.c801aap-2;
float b = CONCATENATE (+、0x1.c801aap-2);
float c = CONCATENATE (+0x1.、c801aap-2);
float d = CONCATENATE (+0x1.c801aa、p-2);
CCS 输出为:
****为项目 test_hexfloat_macro 构建配置调试****
"C:\\ti\\ccsv6\\utils\\bin\\gmake"-k all
'生成文件:./main.c'
'调用:C2000编译器'
"c:/ti/ccsv6/tools/compiler/ti-cgt-c2000_17.6.0.STS/bin/cl2000 -v28 -ml -mt --cla_support=cla1 -float_support=fpu32 -tmu_support=tmu0 -vcu_support=vcu2 -include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c2000_17.6.0.STS/include -g -diag_warning=225 -diag_wrap=off -display_error_number-preproc_prelisting_main_proc_prelisting_main_proc_main_proc_deconusing."
>>编译失败
subdir_rules.mk:7:目标'main.obj'的配方失败
"./main.c"、第3行:警告#1934-D:在宏"CONCATENATE"中与"0x1.c801aap-2连接不会创建有效的令牌
"./main.c"、第4行:错误#168:无效的浮点常量
"./main.c"、第5行:错误#168:无效的浮点常量
2在编译"./main.c"时检测到错误。
gmake:***[main.obj]错误1.
gmake:目标"全部"不会由于错误而重新生成。
****构建完成****
然而、预处理器列表表明、预处理器的输出在所有情况下都是相同的:
l 1 "../main.c"
n#define CONCATENATE (a、b) a ## b
Nfloat A =+0x1.c801aap-2;
w "./main.c" 3 11在宏"CONCATENATE"中与"0x1.c801aap-2连接不会创建有效的令牌
nfloat b = CONCATENATE (+、0x1.c801aap-2);
Xfloat b =+0x1.c801aap-2;
e "../main.c" 4 11无效的浮点常量
nfloat c = CONCATENATE (+0x1.、c801aap-2);
Xfloat c =+0x1.c801aap-2;
e "../main.c" 5 11无效的浮点常量
nfloat d = CONCATENATE (+0x1.c801aa、p-2);
Xfloat d =+0x1.c801aap-2;
预处理源(*。pp 文件)也意味着这种情况:
float A =+0x1.c801aap-2;
float b =+0x1.c801aap-2;
float c =+0x1.c801aap-2;
float d =+0x1.c801aap-2;
这里发生什么事了? 我是否违反了 C 预处理器标准?