毗连“"aa"”和“"bb"”不能给出一个有效的预处理标识符,gcc编译错误表

在C编程中遇到GCC编译错误,提示'##'不能出现在宏展开的两端。错误发生在尝试使用JOIN宏连接字符串“aa”和“bb”时。其他错误包括预处理标识符的有效性和iconv转换问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

gcc bug :
##’ cannot appear at either end of a macro expansion”
‘##’不能出现在宏展开的两端”

10.c: 在函数‘main’中:
10.c:14:1: 错误:毗连“"aa"”和“"bb"”不能给出一个有效的预处理标识符

1 #include<stdio.h>
2
3 #define MAX(a,b) ((a>b) ? a:b)
4
5 #define JOIN(a,b) a##b
6
7 int main()
8 {
9
10 double b = MAX(1.0,1.1);
11 printf("max: %f\n", b);
12 char *a = "123";
13 char *c = "abc";
14 JOIN("aa","bb");
15 //printf("##-- > :%s",JOIN(a,c));
16
17 //printf("ss: %s\n",ss);
18
19 return 1;
20 }

gcc编译错误表
gcc编译错误表

conversion from %s to %s not supported by iconv”
iconv 不支持从 %s 到 %s 的转换”

iconv_open”
iconv_open”

no iconv implementation, cannot convert from %s to %s”
没有 iconv 的实现,无法从 %s 转换到 %s”

character 0x%lx is not in the basic source character set\n”
字符 0x%lx 不在基本源字符集中\n”

converting to execution character set”
转换到可执行文件的字符集”

character 0x%lx is not unibyte in execution character set”
字符 0x%lx 在执行字符集中不是单字节的”

Character %x might not be NFKC”
字符 %x 可能不是 NFKC”

universal character names are only valid in C++ and C99″
Unicode 字符名只在 C++ 和 C99 中有效”

the meaning of ‘\\%c’ is different in traditional C”
‘\\%c’的意义与在传统 C 中不同”

In _cpp_valid_ucn but not a UCN”
在 _cpp_valid_ucn 中但不是一个 UCN”

incomplete universal character name %.*s”
不完全的 Unicode 字符名 %.*s”

%.*s is not a valid universal character”
%.*s 不是一个有效的 Unicode 字符”

‘$’ in identifier or number”
‘$’出现在标识符或数字中”

universal character %.*s is not valid in an identifier”
Unicode 字符 %.*s 在标识符中无效”

universal character %.*s is not valid at the start of an identifier”
Unicode 字符 %.*s 在标识符开头无效”

converting UCN to source character set”
将 UCN 转换到源字符集”

converting UCN to execution character set”
将 UCN 转换到执行字符集”

the meaning of ‘\\x’ is different in traditional C”
‘\\x’的意义与在传统 C 中不同”

\\x used with no following hex digits”
\\x 后没有 16 进制数字”

hex escape sequence out of range”
16 进制转义序列越界”

octal escape sequence out of range”
8 进制转义序列越界”

the meaning of ‘\\a’ is different in traditional C”
‘\\a’的意义与在传统 C 中不同”

non-ISO-standard escape sequence, ‘\\%c’”
非 ISO 标准的转义序列,‘\\%c’”

unknown escape sequence: ‘\\%c’”
未知的转义序列:‘\\%c’”

unknown escape sequence: ‘\\%s’”
未知的转义序列:‘\\%s’”

converting escape sequence to execution character set”
将转义序列转换到执行字符集”

character constant too long for its type”
字符常量大小超出其类型”

multi-character character constant”
多字节字符常量”

empty character constant”
空的字符常量”

failure to convert %s to %s”
无法从 %s 转换到 %s”

extra tokens at end of #%s directive”
#%s 指示的末尾有多余的标识符”

#%s is a GCC extension”
#%s 是一个 GCC 扩展”

#%s is a deprecated GCC extension”
#%s 是一个已过时的 GCC 扩展”

suggest not using #elif in traditional C”
建议在传统 C 中不使用 #elif”
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值