gcc 常见的编译警告与错误(按字母顺序排列)备课讲稿 下载本文

内容发布更新时间 : 2024/11/14 14:18:48星期一 下面是文章的全部内容请认真阅读。

精品文档

missing ‘)’ in macro parameter list 在宏参数表中缺少‘)’

missing ‘)’ to complete answer 完整的答案缺少‘)’

missing binary operator before token \\%s\\ 标识符“%”s前缺少二元运算符

missing expression between ‘(‘ and ‘)’ ‘(’与‘)’之间缺少表达式

missing terminating %c character 缺少结尾的 %c 字符

missing terminating > character 缺少结尾的 > 字符

missing whitespace after the macro name 宏名后缺少空白

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

multi-line comment 多行注释

Multiple include guards may be useful for:\\n 多个防止重包含可能对其有用:\\n

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

收集于网络,如有侵权请联系管理员删除

精品文档

no include path in which to search for %s 没有包含路径可供搜索 %s

no macro name given in #%s directive #%s 指示中未给出宏名

no newline at end of file 在文件最后一行加上回车键

解释:在“Rationale for the C99 standard”一文中,有C99的相关信息: A backslash immediately before a newline has long been used to continue string literals, as well as preprocessing command lines. In the interest of easing machine generation of C, and of transporting code to machines with restrictive physical line lengths, the C89 Committee generalized this mechanism to permit any token to be continued by interposing a backslash/newline sequence.

c/c++代码的每一行后面有一个“结束符”,也就是newline。避免当被include的文件展开后,前一个文件的最后一行与后一个文件的第一行直接被连接成一行从而造成错误。

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

null character(s) ignored 忽略空字符

null character(s) preserved in literal 空字符将保留在字面字符串中

NULL directory in find_file find_file 中有 NULL 目录

octal escape sequence out of range

收集于网络,如有侵权请联系管理员删除

精品文档

8 进制转义序列越界

one or more PCH files were found, but they were invalid 找到一个或多个 PCH 文件,但它们是无效的

operator \\defined\\ requires an identifier 操作符“defined需要一个标识符

operator ‘%s’ has no left operand 操作符‘%s’没有左操作数

operator ‘%s’ has no right operand 操作符‘%s’没有右操作数

passing argument 1 of 'mes_read_time' discards qualifiers from pointer target type12、

mes_函数第一个参数的传递,丢弃了指针目标类型限定。

parameter name missing 缺少形参名

passing argument 1 of 'send' makes pointer from integer without a cast

函数send的第一个integer型参数没有强制转换为pointer型

pasting \\%s\\ and \\%s\\ does not give a valid preprocessing token 毗连“%s”和“%s”不能给出一个有效的预处理标识符

poisoning existing macro \\%s\\ 对已存在的宏“%s”投毒

predicate must be an identifier 谓词必须是一个标识符

收集于网络,如有侵权请联系管理员删除

精品文档

predicate’s answer is empty 谓词的答案为空

preprocessor arithmetic has maximum precision of %lu bits; target requires %lu bits 预处理算术的最高精度为 %lu 位;目标需要 %lu 位

raw string delimiter longer than 16 characters 原始字符串分隔符长过 16 个字符

registering \\%s\\ as both a pragma and a pragma namespace “%s”既被注册为一个pragma 又被注册为一个 pragma 命名空间

registering pragma \\%s\\ with name expansion and no namespace pragma “%s”被注册为一个命名扩展,而没有命名空间

registering pragma with NULL handler pragma 注册为被 NULL 处理

registering pragmas in namespace \\%s\\ with mismatched name expansion 在命名空间“%s”中注册 pragma 时名称扩展不匹配

return makes pointer from integer without a cast return使integer转换为pointer,没有加强制类型转换。

style of line directive is a GCC extension line 指示的风格是一个 GCC 扩展

suffix for double constant is a GCC extension 双精度常量后缀是一个 GCC 扩展

suggest hiding #%s from traditional C with an indented # 建议使用缩进的 # 以让 #%s 对传统 C 不可见

收集于网络,如有侵权请联系管理员删除

精品文档

suggest not using #elif in traditional C 建议在传统 C 中不使用 #elif

syntax error in macro parameter list 宏参数列表语法错误

target char is less than 8 bits wide 目标 char 短于 8 位

target int is narrower than target char 目标 int 短于目标 char

target wchar_t is narrower than target char 目录 wchar_t 短于目标 char

the conditional began here 条件自此开始

the left operand of \\%s\\ changes sign when promoted “%s的左操作数在提升时变换了符号

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

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

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

the right operand of \\%s\\ changes sign when promoted “%s的右操作数在提升时变换了符号

收集于网络,如有侵权请联系管理员删除